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.