US 12,332,883 B2
Method and system for query optimization
Joshua Ball, Sunnyvale, CA (US)
Assigned to YAHOO ASSETS LLC, Dulles, VA (US)
Filed by YAHOO ASSETS LLC, Dulles, VA (US)
Filed on Mar. 6, 2017, as Appl. No. 15/450,809.
Prior Publication US 2018/0253471 A1, Sep. 6, 2018
Int. Cl. G06F 16/24 (2019.01); G06F 16/2453 (2019.01)
CPC G06F 16/24534 (2019.01) [G06F 16/24537 (2019.01)] 17 Claims
OG exemplary drawing
 
1. A method implemented on a machine having at least one processor, storage, and communication platform connected to a network for optimizing query streams, comprising:
receiving, by a query optimizer, a query stream comprising a first plurality of queries from one or more applications via the network; and
in response to identifying in a storage that the first plurality of queries are different from a second plurality of queries of a previously optimized query stream,
determining, by the query optimizer, relationships among the first plurality of queries, wherein each of the relationships is associated with a prior probability;
generating, by the query optimizer, a predicted representation of the first plurality of queries based on the relationships with the corresponding prior probabilities;
selecting, by the query optimizer, based on the predicted representation, at least two queries from the received query stream, wherein each of the at least two queries includes multiple query statements;
re-writing, by the query optimizer, the at least two queries by combining the at least two queries into a single query to reduce a number of the first plurality of queries, wherein the single query includes at least part of content included in each of the least two queries and new content not in any of the at least two queries, and the single query has a fewer number of query statements than the total number of query statements included in the at least two queries;
updating, by the query optimizer, prior probabilities based on queries in the optimized query stream; and
communicating, by the query optimizer, with a remote database to send the optimized query stream to the remote database to reduce communication between the one or more applications and the remote database.