EFFICIENT QUERY PROCESSING ON ORDERED VIEWS
First Claim
1. A method for efficient query processing on ordered views by a computing device comprising a processor, comprising:
- obtaining a view definition for a view for database data, the view definition comprising one or more view sorts;
obtaining a query to be executed on the database data;
identifying any columns in the view that are non-projected for the query;
after processing any predicates of the query, identifying at least one view sort that is based on at least one non-projected view column and affects which rows of the database data will be in the view; and
rewriting the query to eliminate the non-projected view columns and to apply the at least one view sort.
1 Assignment
0 Petitions
Accused Products
Abstract
The efficient query processing on ordered views includes: obtaining a view definition for a view for database data; obtaining a query to be executed on the database data; identifying any columns in the view that are unnecessary for the query; after processing any predicates of the query, identifying any sorts in the view definition that are unnecessary or redundant in the query; rewriting the query to eliminate the unnecessary columns and unnecessary and redundant sorts; and executing the rewritten query without materializing the view. Thus, the query is rewritten in a way that avoids materializing the view and eliminates duplicate or unnecessary sorts. This reduces the number of rows to be sorted and eliminates unnecessary columns from materialization. These reductions lead to resource savings, including memory, temporary table space required for sorting, and CPU resources.
23 Citations
21 Claims
-
1. A method for efficient query processing on ordered views by a computing device comprising a processor, comprising:
-
obtaining a view definition for a view for database data, the view definition comprising one or more view sorts; obtaining a query to be executed on the database data; identifying any columns in the view that are non-projected for the query; after processing any predicates of the query, identifying at least one view sort that is based on at least one non-projected view column and affects which rows of the database data will be in the view; and rewriting the query to eliminate the non-projected view columns and to apply the at least one view sort. - View Dependent Claims (2, 3, 4)
-
-
5. (canceled)
-
7. A method for efficient query processing on ordered views by a computing device comprising a processor, comprising:
-
obtaining a view definition for a view for database data, the view definition comprising one or more view sorts; obtaining a query to be executed on the database data, the query comprising one or more query sorts; identifying any columns in the view that are non-projected for the query; after processing any predicates of the query, determining that at least one view sort is based on at least one projected view column; determining whether the at least one view sort is redundant to any query sort; in response to determining that the at least one view sort is based on the at least one projected view column and that the at least one view sort is not redundant to any query sort, building a composite sort from the at least one view sort and the one or more query sorts; and rewriting the query to eliminate the non-projected view columns and to apply the composite sort to the query. - View Dependent Claims (6)
-
-
8. A computer program product for efficient query processing on ordered views, the computer program product comprising:
-
a computer readable memory device having computer readable program code embodied therewith, the computer readable program code configured to; obtain a view definition for a view for database data, the view definition comprising one or more view sorts; obtain a query to be executed on the database data; identify any columns in the view that are non-projected for the query; after processing any predicates of the query, identify at least one view sort that is based on at least one non-projected view column and affects which rows of the database data will be in the view; and rewrite the query to eliminate the non-projected view columns and to apply the at least one view sort. - View Dependent Claims (9, 10, 11)
-
-
12. (canceled)
-
14. A computer program product for efficient query processing on ordered views, the computer program product comprising:
-
a computer readable memory device having computer readable program code embodied therewith, the computer readable program code configured to; obtain a view definition for a view for database data, the view definition comprising one or more view sorts; obtain a query to be executed on the database data, the query comprising one or more query sorts; identify any columns in the view that are non-projected for the query; after processing any predicates of the query, determine that at least one view sort is based on at least one projected view column; determine whether the at least one view sort is redundant to any query sort; in response to determining that the at least one view sort is based on the at least one projected view column and that the at least one view sort is not redundant to any query sort, build a composite sort from the at least one view sort and the one or more query sorts; and rewrite the query to eliminate the non-projected view columns and to apply the composite sort to the query. - View Dependent Claims (13)
-
-
15. A system, comprising:
-
a processor; and a computer readable memory device having computer readable program code embodied therewith executable by the processor, the computer readable program code configured to; obtain a view definition for a view for database data, the view definition comprising one or more view sorts; obtain a query to be executed on the database data; identify any columns in the view that are non-projected for the query; after processing any predicates of the query, identify at least one view sort that is based on at least one non-projected view column and affects which rows of the database data will be in the view; and rewrite the query to eliminate the non-projected view columns and to apply the at least one view sort. - View Dependent Claims (16, 17, 18)
-
-
19. (canceled)
-
21. A system, comprising:
-
a processor; and a computer readable memory device having computer readable program code embodied therewith executable by the processor, the computer readable program code configured to; obtain a view definition for a view for database data, the view definition comprising one or more view sorts; obtain a query to be executed on the database data, the query comprising one or more query sorts; identify any columns in the view that are non-projected for the query; after processing any predicates of the query, determine that at least one view sort is based on at least one projected view column; determine whether the at least one view sort is redundant to any query sort; in response to determining that the at least one view sort is based on the at least one projected view column and that the at least one view sort is not redundant to any query sort, build a composite sort from the at least one view sort and the one or more query sorts; and rewrite the query to eliminate the non-projected view columns and to apply the composite sort to the query. - View Dependent Claims (20)
-
Specification