Semantic optimization of query order requirements using order detection by normalization in a query compiler system
First Claim
1. A method for order detection during processing of a query in a relational database processing system having a stored database including a plurality of base-relations {T} and a data processor for processing queries represented by query graphs {G}, wherein each said query graph G includes a plurality of relation nodes {Ni } each representing a relational operation associated with a record ordering requirement represented by an order requirement vector ORi, wherein each said relation node Ni is connected to at least one other said relation node Nj by a directed record stream Rij representing a record stream output from said each relation node Ni and a record stream input to said other relation node Nj ordered according to an order property vector OPi, wherein i and j are positive integers, said method comprising the steps of:
- (a) normalizing said order property vector OPi to produce a normalized order property vector OPNi for said input record stream Rji of a first said relation node Ni ;
(b) normalizing said order requirement vector ORi to produce a normalized order requirement vector ORNi for said first relation node Ni ; and
(c) comparing said normalized order requirement vector ORNi to said normalized order property vector OPNi to detect an ordering requirement for said first relation node Ni.
1 Assignment
0 Petitions
Accused Products
Abstract
A procedure for detecting a reordering requirement in a directed record stream during query execution in a relational database processing system. The query compiler component of a relational database processing system includes procedures for building query execution plans (QEPs) for evaluation preparatory to selecting an optimal plan for execution. These plans are constructed from the bottom up using an internal graphical representation for the user query that has a number of relation nodes interconnected by directed record streams (data flows). A relational operation within each node imposes an "order requirement" on the outflow stream represented by an order requirement vector OR. The records within each directed record stream have an "order property" represented by an order property vector OP. Order detection occurs when these two vectors are compared to determine whether the order property satisfies the order requirement. Order detection by normalization (ODN) according to this invention first normalizes the two order specification vectors to remove all attributes made redundant by the effects of predicates and functional dependencies. Query execution plans constructed using ODN are found to execute an order of magnitude faster than those constructed using order detection without normalization.
-
Citations
20 Claims
-
1. A method for order detection during processing of a query in a relational database processing system having a stored database including a plurality of base-relations {T} and a data processor for processing queries represented by query graphs {G}, wherein each said query graph G includes a plurality of relation nodes {Ni } each representing a relational operation associated with a record ordering requirement represented by an order requirement vector ORi, wherein each said relation node Ni is connected to at least one other said relation node Nj by a directed record stream Rij representing a record stream output from said each relation node Ni and a record stream input to said other relation node Nj ordered according to an order property vector OPi, wherein i and j are positive integers, said method comprising the steps of:
-
(a) normalizing said order property vector OPi to produce a normalized order property vector OPNi for said input record stream Rji of a first said relation node Ni ; (b) normalizing said order requirement vector ORi to produce a normalized order requirement vector ORNi for said first relation node Ni ; and (c) comparing said normalized order requirement vector ORNi to said normalized order property vector OPNi to detect an ordering requirement for said first relation node Ni. - View Dependent Claims (2, 3, 4, 5)
-
-
6. A query compiler system in a relational database processing system comprising:
-
a data processor for processing queries represented by query graphs {G}, wherein each said query graph G includes a plurality of relation nodes {Ni } each representing a relational operation associated with a record ordering requirement represented by an order requirement vector ORi, wherein each said relation node Ni is connected to at least one other said relation node Nj by a directed record stream Rij representing a record stream output from said each relation node Ni and a record stream input to said other relation node Nj ordered according to an order property vector OPi, wherein i and j are positive integers; normalizing means in said data processor for normalizing said order property vector OPi to produce a normalized order property vector OPNi for said input record stream Pji of a first said relation node Ni and for normalizing said order requirement vector ORi to produce a normalized order requirement vector ORNi for said first relation node Ni ; and order detection means coupled to said normalizing means for comparing said normalized order requirement vector ORNi to said normalized order property vector OPNi to detect an ordering requirement for said first relation node Ni. - View Dependent Claims (7, 8, 9, 10)
-
-
11. A database processing system comprising:
-
a stored database including a plurality of base-relations {T}; a data processor for processing queries represented by query graphs {G}, wherein each said query graph G includes a plurality of relation nodes {Ni } each representing a relational operation associated with a record ordering requirement represented by an order requirement vector ORi, wherein each said relation node Ni is connected to at least one other said relation node Nj by a directed record stream Rij representing a record stream output from said each relation node Ni and a record stream input to said other relation node Nj ordered according to an order property vector OPi, wherein i and j are positive integers; normalizing means in said data processor for normalizing said order property vector OPi to produce a normalized order property vector OPNi for said input record stream Rji of a first said relation node Ni and for normalizing said order requirement vector ORi to produce a normalized order requirement vector ORNi for said first relation node Ni ; and order detection means coupled to said normalizing means for comparing said normalized order requirement vector ORNi to said normalized order property vector OPNi to detect an ordering requirement for said first relation node Ni. - View Dependent Claims (12, 13, 14, 15)
-
-
16. A computer program product, for use with a relational database processing system having a stored database including a plurality of base-relations {T} and a data processor for processing queries represented by query graphs {G}, wherein each said query graph G includes a plurality of relation nodes {Ni } each representing a relational operation associated with a record ordering requirement represented by an order requirement vector ORi, wherein each said relation node Ni is connected to at least one other said relation node Nj by a directed record stream Rij representing a record stream output from said each relation node Ni and a record stream input to said other relation node Nj ordered according to an order property vector OPi, wherein i and j are positive integers, said computer program product comprising:
-
a recording medium; means, recorded on said recording medium, for directing said data processor to normalize said order property vector OPi to produce a normalized order property vector OPNi for said input record stream Rji of a first said relation node Ni ; means, recorded on said recording medium, for directing said data processor to normalize said order requirement vector ORi to produce a normalized order requirement vector ORNi for said first relation node Ni ; and means, recorded on said recording medium, for directing said data processor to compare said normalized order requirement vector ORNi to said normalized order property vector OPNi to detect an ordering requirement for said first relation node Ni. - View Dependent Claims (17, 18, 19, 20)
-
Specification