SAP Sybase IQ Index Fragmentation


This section show the fragmentation on indexes of a table in IQ: (SQL: sp_iqindexfragmentation ('table <owner.table>'))” , this Stored procedure can be used to check the index fragmentation.

Stored procedure reports information about the percentage of page space taken up within the B-trees, garrays, and bitmap structures in Sybase IQ indexes.

 
Note: All percentages are truncated to the nearest percentage point. HG indexes also display the value of option GARRAY_FILL_FACTOR_PERCENT. Index types that use a B-tree also display the number of node (nonleaf) pages. These are HG, LF, WD, DATE, and DTTM.

 
For garrays, the fill percentage calculation does not take into account the reserved space within the garray groups, which is controlled by the GARRAY_FILL_FACTOR_PERCENT option. It specifies the percent of space on each HG garray pages to reserve for future incremental inserts into existing groups. The garray tries to pad out each group to include a pad of empty space set by the value. This space is used for rows added to existing index groups. Default value is 25.

 
GARRAY_PAGE_SPLIT_PAD_PERCENT option, determines per-page fill factor during page splits on the garray and specifies the percent of space on each HG garray page to reserve for future incremental inserts. Splits of a garray page try to leave that percentage empty. This space is used for rows added to new index groups. Default value: 25.

 
sp_iqrowdensity ('table <owner>. <table_name>') //This stored procedure can be used to report row fragmentation

 

Additionally,

sp_iqindex ('<table_name>')0

sp_iqcolumn ('<table_name>')

sp_iqindexfragmentation ('table <owner>. <table_name>')

sp_iqindexsize ('<owner>. <table_name>.<index_name>')

sp_iqindexinfo ('table <owner>. <table_name>')

sp_iqspaceinfo('table <owner>. <table_name>')

sp_iqcheckdb('verify index <owner>. <table_name>.<index_name>')

CALL sa_index_density( 'Customers' );

To rebuild index if issue found:

-         Store procedure sp_iqrebuiltindex can be used to rebuild the indexes and reduce the fragmentation.

e.g.

        sp_iqrebuiltindex (<table_name>, <index_clause>)

Comments

Popular posts from this blog