Query plan management in shared distributed data stores
AssigneePivotal Software, Inc.
InventorsGavin Sherry, Radhika Reddy, Caleb E. Welton
Life of this patent
Estimating the term…
Abstract
The invention identifies and caches query plans in a shared-nothing distributed data store that are unlikely to become invalid because they do not reference objects that are likely to be changed or deleted. Plans that are likely to become invalid and are not cached are those plans that reference data that is partitioned across segment/query execution nodes of the data store, plans that are complex, and plans that reference objects that are not “built-in” (primitive) objects. The effect is that most plans which are generated on a query dispatch (master) node are not cached, whereas most plans generated on an execution (segment) node are cached.
Claims15
A method, comprising:
- obtaining a query plan by a data store system having a master node and a plurality of segment nodes, each node of the data store system comprising a respective processor and a respective non-transitory storage medium, wherein the master node is a query distributing node, and each segment node is a query executing node;
- determining, by the data store system, a likelihood of the query plan becoming invalid, comprising:
- determining whether the query plan was generated on the master node or on a segment node of the data store system;
- upon determining that the query plan was generated on a segment node, designating the likelihood as low;
- and
- upon determining that the query plan was generated on the master node, performing actions comprising:
- determining an estimated complexity value representing an order of complexity of the query plan and designating the query plan as complex or not complex based on the complexity value, wherein more objects being referenced by the query plan correspond to a higher complexity value;
- upon designating the query plan as complex, designating the likelihood as high;
- and
- upon designating the query plan as not complex, performing actions comprising:
- determining whether the query plan contains one or more objects that are different from built-in objects;
- and
- upon determining that the query plan contains one or more objects that are different from built-in objects, designating the likelihood as low, otherwise designating the likelihood as high;
- and
- caching the query plan upon determining that the likelihood of the query plan becoming invalid is low.
Computer readable non-transitory storage medium product storing executable instructions for causing one or more computers to perform operations comprising:
- obtaining a query plan by a data store system having a master node and a plurality of segment nodes, each node of the data store system comprising a respective processor and a respective non-transitory storage medium, wherein the master node is a query distributing node, and each segment node is a query executing node;
- determining, by the data store system, a likelihood of the query plan becoming invalid, comprising:
- determining whether the query plan was generated on the master node or on a segment node of the data store system;
- upon determining that the query plan was generated on the segment node, designating the likelihood of the query plan becoming invalid as low;
- and
- upon determining that the query plan was generated on the master node, performing actions comprising:
- determining an estimated complexity value representing complexity of the query plan and designating the query plan as complex or not complex based on the complexity value, wherein more objects being referenced by the query plan correspond to a higher complexity value;
- upon designating the query plan as complex, designating the likelihood as high;
- and
- upon designating the query plan as not complex, performing actions comprising:
- determining whether the query plan contains one or more objects that are different from built-in objects;
- and
- upon determining that the query plan contains one or more that are different from built-in objects, designating the likelihood of the query plan becoming invalid as low, otherwise designating the likelihood of the query plan becoming invalid as high;
- and
- caching the query plan upon determining that the likelihood of the query plan becoming invalid is low.
A data store system, comprising:
- a master node comprising a processor;
- a plurality of segment nodes each comprising a respective processor, each node of the data store system comprising a respective processor and a respective non-transitory storage medium, wherein the master node is a query distributing node, and each segment node is a query executing node;
- and
- a non-transitory storage medium storing instructions operable to cause the processors to perform operations comprising:
- obtaining a query plan by the data store system;
- determining, by the data store system, a likelihood of the query plan becoming invalid, comprising:
- determining whether the query plan was generated on the master node or on a segment node of the data store system;
- upon determining that the query plan was generated on a segment node, designating the likelihood as low;
- and
- upon determining that the query plan was generated on the master node, perform action comprising:
- determining an estimated complexity value representing complexity of the query plan and designating the query plan as complex or not complex based on the complexity value, wherein more objects being referenced by the query plan correspond to a higher complexity value;
- upon designating the query plan as complex, designating the likelihood as high;
- and
- upon designating the query plan as not complex, performing actions comprising:
- determining whether the query plan contains one or more objects that are different from built-in objects;
- and
- upon determining that the query plan contains one or more that are different from built-in objects, designating the likelihood of the query plan becoming invalid as low, otherwise designating the likelihood of the query plan becoming invalid as high;
- and
- caching the query plan upon determining that the likelihood of the query plan becoming invalid is low.
Dependencies are inferred from the claim text.