Query optimization using join cardinality

US10133778B2 · US · B2

Patent metadata
FieldValue
Publication numberUS-10133778-B2
Application numberUS-201514947252-A
CountryUS
Kind codeB2
Filing dateNov 20, 2015
Priority dateNov 20, 2015
Publication dateNov 20, 2018
Grant dateNov 20, 2018

How to read this patent

A practical reading order for non-experts. Skip the full description unless you need deep technical detail.

  1. Title

    What the patent document calls the invention.

  2. Abstract

    A short plain-language summary of the technical disclosure.

  3. Assignees and inventors

    Who owns or filed the patent and who is credited as inventor.

  4. Key dates

    Filing, priority, publication, and grant dates set the timeline.

  5. First independent claim

    The legal scope of protection — read this for what is actually claimed.

  6. CPC / IPC classifications

    Technology tags used to group this patent with similar filings.

  7. Citations and related patents

    Prior art links and similar publications in this corpus.

Abstract

Official abstract text for this publication.

Disclosed herein are system, method, and computer program product embodiments for utilizing join cardinality to improve the performance of query processing. An embodiment operates by a database engine receiving a query including a join operation on a first and a second table using a join predicate, and a tag for the join operation indicating a cardinality relationship between the first and the second table when satisfying the join predicate. Then, the database engine generates a query processing plan for performing the query. For the join operation, the database engine selects one of the first or the second tables to remove from the join operation based on a type of the join operation and the tag. Based on the selecting, the database engine may remove may the join operation and the selected table from the query processing plan.

First claim

Opening claim text (preview).

What is claimed is: 1. A computer-implemented method, comprising: receiving a query including a join operation on a first and a second table using a join predicate, and a tag for the join operation indicating a cardinality relationship between the first and the second table when satisfying the join predicate; generating a query processing plan for performing the query; selecting, based on a type of the join operation and the tag, one of the first or the second tables to remove from the join operation; and removing, based on the selecting, the join operation and the selected table from the query processing plan, wherein at least one of the receiving, generating, removing, and verifying are performed by one or more computers. 2. The method of claim 1 , wherein the first table is representative of one of a table stored in a database, a joined table created from joining the first table with a second table in the database, or a second joined table created from joining the first joined table with a third table in the database. 3. The method of claim 1 , herein the tag includes a first part and a second part, wherein the first part indicates a cardinality of the first table with respect to the second table, and wherein the second part indicates a cardinality of the second table with respect to the first table. 4. The method of claim 1 , wherein the selecting comprises: comparing the type of the join operation and the tag with programmed optimization criteria to determine the selected table. 5. The method of claim 4 , wherein the selecting further comprises: using a projection of the query processing plan to verify that the selected table can be removed without affecting a result produced by the query processing plan. 6. The method of claim 1 , wherein the query processing plan is represented as a relational binary tree having a projection in a root node and the join operation in an internal node that is parent to a first and a second child node respectively corresponding to the first and second table, and wherein the removing comprises: pruning, from the query processing plan, the internal node and a third child node corresponding to the selected table, wherein the third child node is one of the first and the second child nodes. 7. The method of claim 6 , wherein the verifying comprises: traversing from a parent of the internal node to the root node to check that no ancestor node of the internal node accesses data from the third child node to produce the result of the query. 8. The method of claim 1 , wherein the query includes a plurality of join operations, wherein the query processing plan is represented as a relational binary tree having a root node containing a projection of the query and having a plurality of internal nodes, each internal node corresponding to a respective join operation of the query, and wherein the method further comprises: determining whether each join operation and a corresponding internal node can be pruned from the binary tree without affecting a result produced by the query processing plan; and prioritizing the determining for join operations that are closer to the root node. 9. A system, comprising: a memory; and at least one processor coupled to the memory and configured to: receive a query including a join operation on a first and a second table using a join predicate, and a tag for the join operation indicating a cardinality relationship between the first and the second table when satisfying the join predicate; generate a query processing plan for performing the query; select, based on a type of the join operation and the tag, one of the first or the second tables to remove from the join operation, and remove, based on the selecting, the join operation and the selected table from the query processing plan. 10. The system of claim 9 , wherein the first table is representative of one of a table stored in a database, a joined table created from joining the first table with a second table in the database, or a second joined table created from joining the first joined table h a third table in the database. 11. The system of claim 9 , wherein the tag includes a first part and a second part, wherein the first part indicates a cardinality of the first table with respect to the second table, and wherein the second part indicates a cardinality of the second table with respect to the first table. 12. The system of claim 9 , wherein to select the at least one processor is further configured to: compare the type of the join operation and the tag with programmed optimization criteria to determine the selected table. 13. The system of claim 12 , wherein to select the at least one processor is further configured to: using a projection of the query processing plan to verify that the selected table can be removed without affecting a result produced by the query processing plan. 14. The system of claim 9 , wherein the query processing plan is represented as a relational binary tree having a projection in a root node and the join operation in an internal node that is parent to a first and a second child node respectively corresponding to the first and second table, and wherein to remove the at least one processor is further configured to: prune, from the query processing plan, the internal node and a third child node corresponding to the selected table, wherein the third child node is one of the first and the second child nodes. 15. The system of claim 14 , wherein to verify the at least one processor is further configured to: traverse from a parent of the internal node to the root node to check that no ancestor node of the internal node accesses data from the third child node to produce the result of the query. 16. The system of claim 9 , wherein the query includes a plurality of join operations, wherein the query processing plan is represented as a relational binary tree having a root node containing a projection of the query and having a plurality of internal nodes, each internal node corresponding to a respective join operation of the query, and wherein the at least one processor is further configured to: determine whether each join operation and a corresponding internal node can be pruned from the binary tree without affecting a result produced by the query processing plan; and prioritize the determining for join operations that are closer to the root node. 17. A tangible computer-readable device having instructions stored thereon that, when executed by at least one computing device, causes the at least one computing device to perform operations comprising: receiving a query including a join operation on a first and a second table using a join predicate, and a tag for the join operation indicating a cardinality relationship between the first and the second table when satisfying the join predicate; generating a query processing plan for performing the query; selecting, based on a type of the join operation and the tag, one of the first or the second tables to remove from the join operation; and removing, based on the selecting, the join operation and the selected table from the query processing plan, wherein at least one of the receiving, generating, removing, and verifying are performed by one or more computers. 18. The computer-readable device of claim 15 , wherein the selecting comprises: comparing the type of the join operation and the tag with programmed optimization criteria to determine the selected table; and using a projection of the query processing plan to verify that the selected table can be

Assignees

Inventors

Classifications

  • Join order optimisation · CPC title

  • Information retrieval; Database structures therefor; File system structures therefor · CPC title

  • Physics · mapped topic

  • Physics · mapped topic

Patent family

Related publications grouped by family.

External sources

Frequently asked questions

Answers are generated from the same data shown on this page.

What does patent US10133778B2 cover?
Disclosed herein are system, method, and computer program product embodiments for utilizing join cardinality to improve the performance of query processing. An embodiment operates by a database engine receiving a query including a join operation on a first and a second table using a join predicate, and a tag for the join operation indicating a cardinality relationship between the first and the …
Who is the assignee on this patent?
Sap Se
What technology area does this patent fall under?
Primary CPC classification G06F16/24544. Mapped technology areas include Physics.
When was this patent published?
Publication date Tue Nov 20 2018 00:00:00 GMT+0000 (Coordinated Universal Time) (B2). Legal status and post-grant events are not shown on this page.
What related patents are in patentsdb?
We list 4 related publications on this page (citations in our corpus or others sharing the same primary CPC).