Dropping an index by using What-If Index
This task describes how to use the What-If Index feature to simulate dropping an index.
Use this procedure to simulate dropping an index by using the What-If Index feature.
Before you begin
Perform the following procedures:
- Preparing-to-use-What-If-Index
- Identifying-What-If-Index-candidates
- Adding-an-index-by-using-What-If-Index
The examples in this section are continued from the task Adding-an-index-by-using-What-If-Index.
To drop an index
On the Explain Results panel, type D beside the index that you want to drop, and press Enter.
FILE COMMANDS OPTIONS HELP
-------------------------------------------------------------------------------
PSSPW200 Explain Results for SQLTEXT
Command ===> Scroll ===> CSR
More: >
Actions: S H R RS RW RI XD XS XP W P T C D U IM SA
CLONE Objects in database PSS60364
STMTNO SQL-STATEMENT
117 SELECT * FROM PXB.EMP WHERE LASTNAME = 'BAKER'
CREATOR TBNAME CARD NPAGES COMP NACTIVE PARENT CHILD BPOO
PXB EMP -1 -1 -1 -1 0 0 BP0
CREATOR IXNAME 1STKEY FULLKEY NLEAF NLEVELS CLUSTERRAT
D PXB XEMP2 -1 -1 -1 -1 0.00000000
PXB myindex -1 -1 20 2 0.80000000
LBL STMTNO COST*RATE SQL-STATEMENT
WI01* 117 344.638184 SELECT * FROM PXB.EMP WHERE LASTNAME = 'BAKER'
XD01 117 1012.256592 SELECT * FROM PXB.EMP WHERE LASTNAME = 'BAKER'
COST*RATE QB PL MIX QTYPE METH ACC MTCH IX TBNAME IXNAME NU J O G
WI01* 344.63818 1 1 0 SELECT 0 I 1 N EMP myindex N N N N
XD01 1012.2565 1 1 0 SELECT 0 R 0 N EMP N N N N
******************************** Bottom of Data *******************************The index to be dropped from the clone is removed from the display (as in Explain Results panel showing dropped index). At this point, the index has not yet been dropped even though it is no longer displayed on the panel. The index is dropped when you perform the Explain.
FILE COMMANDS OPTIONS HELP
-------------------------------------------------------------------------------
PSSPW200 Explain Results for SQLTEXT
Command ===> Scroll ===> CSR
More: >
Actions: S H R RS RW RI XD XS XP W P T C D U IM SA
XD CLONE Objects in database PSS60364
STMTNO SQL-STATEMENT
117 SELECT * FROM PXB.EMP WHERE LASTNAME = 'BAKER'
CREATOR TBNAME CARD NPAGES COMP NACTIVE PARENT CHILD BPOO
PXB EMP -1 -1 -1 -1 0 0 BP0
CREATOR IXNAME 1STKEY FULLKEY NLEAF NLEVELS CLUSTERRAT
PXB myindex -1 -1 20 2 0.80000000
LBL STMTNO COST*RATE SQL-STATEMENT
WI01* 117 344.638184 SELECT * FROM PXB.EMP WHERE LASTNAME = 'BAKER'
XD01 117 1012.256592 SELECT * FROM PXB.EMP WHERE LASTNAME = 'BAKER'
COST*RATE QB PL MIX QTYPE METH ACC MTCH IX TBNAME IXNAME NU J O G
WI01* 344.63818 1 1 0 SELECT 0 I 1 N EMP myindex N N N N
XD01 1012.2565 1 1 0 SELECT 0 R 0 N EMP N N N N
******************************** Bottom of Data *******************************To perform a dynamic Explain, type XD in the space beside the clone, and press Enter.The results of the Explain are displayed (in Explain Results panel after index is dropped). The WI02 label represents the Explain on the cloned objects with new index myindex and having dropped index XEMP2.
FILE COMMANDS OPTIONS HELP
-------------------------------------------------------------------------------
PSSPW200 Explain Results for SQLTEXT
Command ===> Scroll ===> CSR
More: >
Actions: S H R RS RW RI XD XS XP W P T C D U IM SA
CLONE Objects in database PSS60364
LBL STMTNO COST*RATE SQL-STATEMENT
WI02 117 344.638184 SELECT * FROM PXB.EMP WHERE LASTNAME = 'BAKER'
WI01* 117 344.638184 SELECT * FROM PXB.EMP WHERE LASTNAME = 'BAKER'
XD01 117 1012.256592 SELECT * FROM PXB.EMP WHERE LASTNAME = 'BAKER'
COST*RATE QB PL MIX QTYPE METH ACC MTCH IX TBNAME IXNAME NU J O G
WI02 344.63818 1 1 0 SELECT 0 I 1 N EMP myindex N N N N
WI01* 344.63818 1 1 0 SELECT 0 I 1 N EMP myindex N N N N
XD01 1012.2565 1 1 0 SELECT 0 R 0 N EMP N N N N
******************************** Bottom of Data *******************************- You can now perform additional What-If Index operations such as adding another index, updating statistics for an index, and so on.
Related topic