sp_iqrowdensity procedure

Function

Reports information about the internal row fragmentation for a table at the FP index level.

Syntax

dbo.sp_iqrowdensity (‘target ‘)
target:(table table-name | (column column-name (...))

Permissions

DBA authority required. Users without DBA authority must be granted EXECUTE permission to run the stored procedure.

Usage

table-name Target table table-name reports on all columns in the named table.

column-name Target column column-name reports on the named column in the target table. You may specify multiple target columns, but must repeat the keyword each time.

You must specify the keywords table and column. These keywords are not case-sensitive.

Description

sp_iqrowdensity measures row fragmentation at the default index level. Density is the ratio of the minimum number of pages required by an index for existing table rows to the number of pages actually used by the index. This procedure returns density as a number such that 0 < density < 1. For example, if an index that requires 8 pages minimum storage occupies 10 pages, its density is .8.

The density reported does not indicate the number of disk pages that may be reclaimed by re-creating or reorganizing the default index.

This procedure displays information about the row density of a column, but does not recommend further action. You must determine whether or not to re-create, reorganize, or rebuild an index.

Example

Reports the row density on column ID in table SalesOrders:

sp_iqrowdensity('column groupo.SalesOrders.ID')

Tablename

ColumnName

IndexType

Density

'GROUPO.SalesOrders'

'ID'

'Flat style FP'

'1.0'

See also

“FP_LOOKUP_SIZE option” and “MINIMIZE_STORAGE option” in Chapter 2, “Database Options” in Reference: Statements and Options.

Chapter 6, “Using Sybase IQ Indexes” in System Administration Guide: Volume 1.