US5758335A
Expired / Lapsed
US
⏱️ 0.0 years remaining
Optimizing table join ordering using graph theory prior to query optimization
Assignee: Bull HN Information Systems Inc
•
Filing: 1996-09-27
•
Granted: 1998-05-26
•
Expires: 2016-09-27
Abstract
Abstract A method for improving the efficiency of queries in relational database management systems that use the exhaustive method of query optimization. The join structure of the query is examined prior to query optimization and tables are ordered according to graph theory. The tables in the FROM clause of the query are then reordered before query optimization. The access plan is thus developed from an already near-optimal table ordering. As a result, the number of table permutations examined during query optimization is pruned, the time to examining large numbers of table order permutations is avoided, and the optimization cost is reduced.
Inventors
- 👤 James E. Gray
Bibliographic Details
Application Number
—
Jurisdiction
US
Data Source
google_patents
Last Synchronized
2026-11-03 22:28
CPC Classifications
G; G06; G06F; G06F16/00; G06F16/20; G06F16/24; G06F16/245; G06F16/2453; G06F16/24534; G06F16/24542; G06F16/24544; G06F16/24547; Y; Y10; Y10S; Y10S707/00; Y10S707/99931; Y10S707/99932; Y10S707/99933; Y10S707/99934; Y10S707/99941; Y10S707/99942
Claims Analysis
Total Claims: 6
Claim 1
Independent Claim
186 words
In a relational database computer system including a data processor, a stored database and a plurality of database tables wherein one or more of the tables are retrieved by the processor by means of query commands performing a plurality of join operations on the tables using a WHERE clause and a FROM clause, a method for improving the query optimization comprising the steps of: a) examining the WHERE clause and finding all join conditions that are present; b) forming a chain of the join conditions; c) establishing a list of tables wherein: I) tables that are in the WHERE clause but not in the join conditions are listed first; ii) tables in the join chains formed according to graph theory are listed next in the same order as they appear in the join chain such that the tables from the longest chains are listed before the tables from shorter chains and all tables at a given distance from a root table of the chain occur together before the next level in the join chain; d) reordering the tables in the FROM clause in the list order.
Claim 2
Dependent Claim
186 words
In a relational database computer system including a data processor, a stored database and a plurality of database tables wherein one or more of the tables are retrieved by the processor by means of query commands performing a plurality of join operations on the tables using a WHERE clause and a FROM clause, a method for improving the query optimization comprising the steps of: a) examining the WHERE clause and finding all join conditions that are present; b) forming a chain of the join conditions; c) establishing a list of tables wherein: I) tables that are in the WHERE clause but not in the join conditions are listed first; ii) tables in the join chains formed according to graph theory are listed next in the same order as they appear in the join chain such that the tables from the longest chains are listed before the tables from shorter chains and all tables at a given distance from a root table of the chain occur together before the next level in the join chain; d) reordering the tables in the FROM clause in the list order.
Claim 3
Dependent Claim
159 words
A computer-implemented method for performing relational database queries on a database comprising a plurality of tables, the method comprising the steps of: a) receiving a user query for extracting certain data values from a plurality of tables in a database, the query comprising at least a FROM clause and a WHERE clause; b) examining the WHERE clause condition in the user query and finding all join conditions that are present; c) forming a chain of the join conditions according to graph theory; d) establishing a list of tables wherein: i) tables that are in the WHERE clause but not in the join chain are listed first; ii) tables in the join chains are listed next in the same order as they appear in the join chain, and the tables from the longest chains are listed before the tables from shorter chains; and e) reordering the tables in the FROM clause in the list order; and f) executing the query.
Claim 4
Dependent Claim
159 words
A computer-implemented method for performing relational database queries on a database comprising a plurality of tables, the method comprising the steps of: a) receiving a user query for extracting certain data values from a plurality of tables in a database, the query comprising at least a FROM clause and a WHERE clause; b) examining the WHERE clause condition in the user query and finding all join conditions that are present; c) forming a chain of the join conditions according to graph theory; d) establishing a list of tables wherein: i) tables that are in the WHERE clause but not in the join chain are listed first; ii) tables in the join chains are listed next in the same order as they appear in the join chain, and the tables from the longest chains are listed before the tables from shorter chains; and e) reordering the tables in the FROM clause in the list order; and f) executing the query.
Claim 5
Dependent Claim
267 words
In a relational database management system comprising a data processor, memory storing a database, and a plurality of tables within the database from which data is retrieved by a user submitting a query comprising a FROM clause and a WHERE clause, wherein an optimal access plan to the data is determined by an algorithm which evaluates substantially all table order permutations, a method for improving the efficiency of query of the database comprising the steps of: a) examining the join structure of the WHERE clause prior to determining the access plan, further comprising the steps of: i) determining tables involved in join operations in the WHERE clause; ii) determining a shortest path to each table involved in a join operation according to graph theory; iii) selecting a join chain of the shortest paths that goes to the most number of tables involved in join operations; and iv) if the join chain does not involve all tables, selecting another join chain of the shortest paths that goes to the most number of remaining tables involved in join operations; v) adding join chains of the shortest paths until all tables involved in join operations are represented; b) ordering the tables in the FROM clause further comprising the steps of: I) listing tables not involved in a join operation first, ii) adding to the list the tables in the order of the join chains of the shortest paths determined in step a above; c) reordering the tables in the FROM clause in list order; d) using the query optimizer to develop the access plan with the newly reordered FROM clause.
Claim 6
Dependent Claim
267 words
In a relational database management system comprising a data processor, memory storing a database, and a plurality of tables within the database from which data is retrieved by a user submitting a query comprising a FROM clause and a WHERE clause, wherein an optimal access plan to the data is determined by an algorithm which evaluates substantially all table order permutations, a method for improving the efficiency of query of the database comprising the steps of: a) examining the join structure of the WHERE clause prior to determining the access plan, further comprising the steps of: i) determining tables involved in join operations in the WHERE clause; ii) determining a shortest path to each table involved in a join operation according to graph theory; iii) selecting a join chain of the shortest paths that goes to the most number of tables involved in join operations; and iv) if the join chain does not involve all tables, selecting another join chain of the shortest paths that goes to the most number of remaining tables involved in join operations; v) adding join chains of the shortest paths until all tables involved in join operations are represented; b) ordering the tables in the FROM clause further comprising the steps of: I) listing tables not involved in a join operation first, ii) adding to the list the tables in the order of the join chains of the shortest paths determined in step a above; c) reordering the tables in the FROM clause in list order; d) using the query optimizer to develop the access plan with the newly reordered FROM clause.
References Cited (Backward Citations)
USPTO Annuity & Maintenance Windows
| Annuity Stage | Window Opens | Payment Deadline | Surcharge Period Until | Estimated Fee | Status |
|---|---|---|---|---|---|
| 3.5 Years (Year 4) | 2001-05-25 | 2001-11-24 | 2002-05-26 | $2000.00 | Window Closed / Lapsed |
| 7.5 Years (Year 8) | 2005-05-25 | 2005-11-24 | 2006-05-26 | $3760.00 | Window Closed / Lapsed |
| 11.5 Years (Year 12) | 2009-05-25 | 2009-11-24 | 2010-05-26 | $7700.00 | Window Closed / Lapsed |