1. A computer-implemented method for query optimization, the computer-implemented method comprising executing instructions in a computer system to perform the operations of: receiving a request for a fact regarding a product offered for purchase in a product catalog from a client, wherein receiving the request for a fact includes receiving a product identifier associated with the product offered for purchase; in response to receiving the request for the fact regarding the product offered for purchase in the product catalog from the client, generating the fact regarding the product offered for purchase in the product catalog and returning the fact regarding the product offered for purchase in the product catalog to the client in response to the request; determining a probability that the client will request one or more additional facts regarding the product offered for purchase in the product catalog, wherein the probability that the client will request the one or more additional facts is determined at least in part on historical requests data describing a probability that the one or more additional facts will be requested following a request for the fact; determining an estimated cost of generating the one or more additional facts regarding the product offered for purchase in the product catalog, wherein the estimated cost is determined at least in part based upon historical cost data describing an actual historical cost to generate the one or more additional facts, the estimated cost comprising one or more of an estimated time, memory usage, processing capacity, or network bandwidth required to generate the one or more additional facts; speculatively generating the one or more additional facts regarding the product offered for purchase in the product catalog based upon the determined probability and the estimated cost of generating the one or more additional facts regarding the product offered for purchase in the product catalog; storing the speculatively generated one or more additional facts regarding the product offered for purchase in the product catalog for use in responding to a future fact request regarding the product offered for purchase in the product catalog from the client; updating the historical cost data with an actual cost to generate the one or more additional facts; receiving a request from the client for the one or more additional facts; and responding to the request for the one or more additional facts with the one or more additional facts.
1. A computer-implemented method for query optimization, the computer-implemented method comprising executing instructions in a computer system to perform the operations of: receiving a request for a fact regarding a product offered for purchase in a product catalog from a client, wherein receiving the request for a fact includes receiving a product identifier associated with the product offered for purchase; in response to receiving the request for the fact regarding the product offered for purchase in the product catalog from the client, generating the fact regarding the product offered for purchase in the product catalog and returning the fact regarding the product offered for purchase in the product catalog to the client in response to the request; determining a probability that the client will request one or more additional facts regarding the product offered for purchase in the product catalog, wherein the probability that the client will request the one or more additional facts is determined at least in part on historical requests data describing a probability that the one or more additional facts will be requested following a request for the fact; determining an estimated cost of generating the one or more additional facts regarding the product offered for purchase in the product catalog, wherein the estimated cost is determined at least in part based upon historical cost data describing an actual historical cost to generate the one or more additional facts, the estimated cost comprising one or more of an estimated time, memory usage, processing capacity, or network bandwidth required to generate the one or more additional facts; speculatively generating the one or more additional facts regarding the product offered for purchase in the product catalog based upon the determined probability and the estimated cost of generating the one or more additional facts regarding the product offered for purchase in the product catalog; storing the speculatively generated one or more additional facts regarding the product offered for purchase in the product catalog for use in responding to a future fact request regarding the product offered for purchase in the product catalog from the client; updating the historical cost data with an actual cost to generate the one or more additional facts; receiving a request from the client for the one or more additional facts; and responding to the request for the one or more additional facts with the one or more additional facts. 11. The computer-implemented method as in claim 1 , further comprising storing the one or more additional facts in a fact cache.