home *** CD-ROM | disk | FTP | other *** search
- ...
- ... $Header: idxstat.doc,v 6002708.1 89/11/07 22:19:33 cyang Exp $ /rcs/6.0/vms_src_log/60027_patches/idxstat.doc Copyr (c) 1989 Oracle
- ...
-
- File : UTL$:IDXSTAT.DOC
- Modification history:
- Porter 09/21/89 Changed to 8 character filenames
- Porter 03/29/89 Created
-
- OVERVIEW:
-
- Very often, when an application is running slowly, the reason will be the
- presence of an unneeded index or the absence of a needed one. These scripts
- help in pinpointing those situations.
-
- SCRIPTS:
-
- Three scripts allow analysis of a user's indexes, or indexed columns:
-
- IDXSTAT.SQL - The main script
- ONEIDXS.SQL - Run for ONE index
- DISPIDXS.SQL - Display statistics
-
- IDXSTAT.SQL - This script runs ONEIDXS.SQL on multiple tables and
- columns. It takes two parameters, the table name and the column name to
- run it on. It will not accept a column that is not part of a non-unique
- index.
-
- ONEIDXS.SQL - This script takes two parameters, the table name and
- the column name to do the analysis on. It will accept any column of
- any table. It should be used to analyze possible new candidates for
- indexes.
-
- DISPIDXS.SQL - This script reports the index statistics generated
- by the previous two scripts. It takes the same two parameters, either
- of which may be wildcarded in standard SQL fashion (%, for example).
-
- USE:
-
- Normally, the user should run IDXSTAT.SQL on their current application,
- then run DISPIDXS.SQL, looking for tables with a large amount
- of BADNESS or very non-distinct keys.
-
- Then, if the user wishes to check on new index columns, use
- ONEIDXS.SQL on those columns.
-
- Since the scripts create two tables (see below), the user should
- remember to drop them when the analysis is finished.
-
- NOTES:
-
- Two tables are created by the scripts - INDEX$INDEX_STATS, which
- holds global statistics for each table, and INDEX$BADNESS_STATS, which
- holds the badness tables for each table.
-
- All scripts must be run from within SQLPLUS, version 3.0.3.1 or later.
- This is to obtain the code the treats the NEW_VALUE clause correctly.
-
- The code currently does not understand concatenated indexes.
-
- The code should go and see how many rows per block are being used in the
- table, and this would allow better statistics about db_block_gets to be made.
-