Method and apparatus for viewing the effect of changes to an index for a database table on an optimization plan for a database query
First Claim
1. In a database management system including an original table having structural information and data stored in a database, a method for determining changes to an original optimization plan for a query to the database, the query including a reference to the original table, the method comprising:
- copying the original table, including the structural information but excluding the data, to define a virtual table;
replacing, in the query, the reference to the original table with a reference to the virtual table; and
determining a new optimization plan for the query.
4 Assignments
0 Petitions
Accused Products
Abstract
A method and apparatus for viewing the effect of changes to an index for a database table on an optimization plan for a database query, such as an SQL statement. A virtual table is created which mimics the structure of an original table on the database. The virtual table is created by copying the original table, excluding any data in the original table. Any existing original indexes associated with original table are copied to define a virtual index associated with the virtual table. References in the query to the original table are replaced with references to the virtual table. The database management system then determines a new optimization plan for the query.
32 Citations
39 Claims
-
1. In a database management system including an original table having structural information and data stored in a database, a method for determining changes to an original optimization plan for a query to the database, the query including a reference to the original table, the method comprising:
-
copying the original table, including the structural information but excluding the data, to define a virtual table;
replacing, in the query, the reference to the original table with a reference to the virtual table; and
determining a new optimization plan for the query. - View Dependent Claims (2, 3, 4, 5, 6)
replacing, in the new optimization plan, a reference to the virtual table with the reference to the original table.
-
-
6. The method of claim 5 further comprising, before comparing the new optimization plan and the original optimization plan:
displaying the new optimization plan with the reference to the original table.
-
7. In a database management system including an original table having structural information and data stored in a database, a method for determining changes to an original optimization plan for a query to the database, the query including a reference to the original table, the method comprising:
-
copying the original table, including the structural information but excluding the data, to define a virtual table;
defining a virtual index associated with the virtual table;
replacing, in the query, the reference to the original table with a reference to the virtual table;
adding, to the query, a reference to the virtual index; and
determining a new optimization plan for the query. - View Dependent Claims (8, 9, 10, 11, 12, 13)
replacing, in the new optimization plan, a reference to the virtual table with the reference to the original table.
-
-
13. The method of claim 12 further comprising, before comparing the new optimization plan and the original optimization plan:
displaying the new optimization plan with the reference to the original table.
-
14. A processor readable storage medium having processor readable code embodied on the processor readable storage medium, the processor readable code for programming a processor to perform a method for determining changes to an original optimization plan for a query to a database, the query including a reference to an original table having structural information and data stored in a database, the method comprising:
-
copying the original table, including the structural information but excluding the data, to define a virtual table;
replacing, in the query, the reference to the original table with a reference to the virtual table; and
determining a new optimization plan for the query. - View Dependent Claims (15, 16, 17, 18, 19)
replacing, in the new optimization plan, a reference to the virtual table with the reference to the original table.
-
-
19. The processor readable storage medium of claim 18, the method further comprising, before comparing the new optimization plan and the original optimization plan:
displaying the new optimization plan with the reference to the original table.
-
20. A processor readable storage medium having processor readable code embodied on the processor readable storage medium, the processor readable code for programming a processor to perform a method for determining changes to an original optimization plan for a query to a database, the query including a reference to an original table having structural information and data stored in a database, the method comprising:
-
copying the original table, including the structural information but excluding the data, to define a virtual table;
defining a virtual index associated with the virtual table;
replacing, in the query, the reference to the original table with a reference to the virtual table;
adding, to the query, a reference to the virtual index; and
determining a new optimization plan for the query. - View Dependent Claims (21, 22, 23, 24, 25, 26)
replacing, in the new optimization plan, a reference to the virtual table with the reference to the original table.
-
-
26. The processor readable storage medium of claim 25, the method further comprising, before comparing the new optimization plan and the original optimization plan:
displaying the new optimization plan with the reference to the original table.
-
27. In a database management system including an original table having structural information and data stored in a database, an apparatus for determining changes to an original optimization plan for a query to the database, the query including a reference to the original table, the apparatus comprising:
-
means for copying the original table, including the structural information but excluding the data, to define a virtual table;
means for replacing, in the query, the reference to the original table with a reference to the virtual table; and
means for determining a new optimization plan for the query. - View Dependent Claims (28, 29, 30, 31, 32)
means for comparing the new optimization plan with the original optimization plan.
-
-
31. The apparatus of claim 27 further comprising:
means for replacing, in the new optimization plan, a reference to the virtual table with the reference to the original table.
-
32. The apparatus of claim 31 further comprising:
means for displaying the new optimization plan with the reference to the original table.
-
33. In a database management system including an original table having structural information and data stored in a database, an apparatus for determining changes to an original optimization plan for a query to the database, the query including a reference to the original table, the apparatus comprising:
-
means for copying the original table, including the structural information but excluding the data, to define a virtual table;
means for defining a virtual index associated with the virtual table;
means for replacing, in the query, the reference to the original table with a reference to the virtual table;
means for adding, to the query, a reference to the virtual index; and
means for determining a new optimization plan for the query. - View Dependent Claims (34, 35, 36, 37, 38, 39)
means for comparing the new optimization plan with the original optimization plan.
-
-
38. The apparatus of claim 33 further comprising:
means for replacing, in the new optimization plan, a reference to the virtual table with the reference to the original table.
-
39. The method of claim 38 further comprising:
means for displaying the new optimization plan with the reference to the original table.
Specification