A good query plan in p2p networks is crucial to increase the query performance. Optimization of the plan requires effective
and suitable remote cost estimation of the candidate peers on the basis of the information concerning the candidates’ run-time
cost model and online time. We propose a fuzzy reward model to evaluate a candidate peer’s online reliability relative to
the query host, and utilize a real-time cost model to estimate the query execution time. The optimizer is based on the run-time
information to generate an effective query plan.