Estimating the compilation time of a query optimizer
AssigneeInternational Business Machines Corporation
InventorsDengfeng Gao, Ihab F. Ilyas, Eileen Tien Lin, Guy Maring Lohman, Jun Rao
Life of this patent
Estimating the term…
Abstract
A compilation time estimator provides a quantified estimate of the optimizer compilation time for a given query optimizer. The estimator automates the optimizer to choose the right level of optimization in commercial database systems. The estimator reuses an optimizer's join enumerator to obtain actual number of joins, but bypasses plan generation to save estimation overhead, and maintains a small number of interesting physical properties to estimate the number of plans by using a linear regression model. The estimator uses the number of generated plans to estimate query compilation time.
Claims20
A computer-based method for estimating a query compilation time of a query optimizer, said computer-based method implemented in computer readable program code stored
- in computer memory, said computer-based method comprising the steps of:
- (a) receiving a query;
- (b) iterating through possible join pairs for said query;
- (c) for each join pair, identifying a set of differentiating properties and using said identified set of differentiating properties to calculate number of join plans, said number of join plans are calculated for any join type selected from a group consisting of:
- nested loops join (NLJN), sort merge join (MGJN), and hash join (HSJN);
- (d) estimating the compilation time from said calculated number of join plans for each type of join method;
- (e) outputting the estimated compilation time;
- and
- wherein plan generation in said query optimizer is by passed.
A computer-based system for estimating query compilation time via reusing a join enumerator in a query optimizer, said system implemented in computer readable program
- code stored in computer memory, said system comprising:
- (a) an interface to receive a query;
- (b) a join enumerator to iterate through possible join pairs for said query, said iteration performed via reusing said join enumerator in said query optimizer;
- (c) a property identifier to identify, for each join pair, a set of differentiating properties and use said identified set of differentiating properties to calculate number of join plans;
- and
- (d) a compilation time estimator to estimate and output compilation time from said calculated number of join plans for each type of join method, wherein said number of join plan are calculated for any join type selected from a group consisting of:
- nested loops join (NLJN), sort merge join (MGJN), and hash join (HSJN), and
- wherein the plan generation is said query optimizer is bypassed.
An article of manufacture comprising computer usable storage medium having computer readable program code embodied therein estimating a query compilation time of a query optimizer via reusing an existing join enumerator in said query optimizer, said computer storage medium comprising:
- (a) computer readable program code aiding in receiving a query;
- (b) computer readable program code iterating through possible join pairs for said query;
- (c) for each join sequence, computer readable program code identifying a set of differentiating properties and using said identified set of differentiating properties to calculate number of join plans, said number of join plans are calculated for any join type selected from a group consisting of:
- nested loops join (NLJN), sort merge join (MGJN), and hash join (HSJN);
- (d) computer readable program code estimating compilation time from said calculated number of join plans for each type of join method;
- (e) computer readable program code outputting the estimated compilation time, and
- wherein the plan generation is said query optimizer is bypassed.
A method for estimating query compilation time in a query optimizer, said computer-based method implemented in computer readable program code stored in computer memory, said computer-based method comprising the steps of:
- bypassing plan generation and reusing a join enumerator of said query optimizer to identify number of joins;
- iterating through possible pairs for a query;
- for each join, accumulating a set of differentiating properties during enumeration and using said identified set of differentiating properties to calculate number of join plans, said number of join plans are calculated for any join type selected from a group consisting of:
- nested loops join (NLJN), sort merge join (MGJN), and hash join (HSJN);
- estimating compilation time from said calculated number of join plans for each type of join method via a regression model;
- outputting said estimated compilation time, and
- wherein the plan generation is said query optimizer is bypassed.
Dependencies are inferred from the claim text.