1. A method of applying rules to queries, the method comprising: applying, by the one or more processors, one or more first rules to a first query to generate a modified query such that processing of the modified query is optimized for a first set of processing conditions; measuring, by the one or more processors, a degree of latency experienced during processing of the modified query under a second set of processing conditions; and generating, by the one or more processors, one or more second rules based, at least in part, on the degree of latency; and updating, by the one or more processors, a set of latency trees that represent latencies measured during execution of a third set of query processes; and generating, by the one or more processors, one or more modified rules based, at least in part, on the updated set of latency trees; analyzing, by the one or more processors, a latency model to determine which pathways can be used to process the received query and generate the result, wherein the analysis identifies a specific pathway to be used to process the received query and to generate the result, and wherein the specific pathway is based, at least in part, on a predicted degree of latency produced by the analysis of the latency model.