sp_iqindexadvice procedure

Function

Displays stored index advice messages. Optionally clears advice storage.

Syntax

sp_iqindexadvice ( [ resetflag ] )

Permissions

This procedure is owned by dbo. Users without DBA authority must be granted execute permission for the stored procedure in order to run it.

Usage

resetflag Lets the caller clear the index advice storage. If resetflag is nonzero, all advice is removed after the last row has been retrieved.

See also

“INDEX_ADVISOR option”

Description

Allows users to query aggregated index advisor messages using SQL. Information can be used to help decide which indexes or schema changes will affect the most queries.

INDEX_ADVISOR columns are described as follows:

Examples

Table 10-24 illustrates sample output from the sp_iqindexadvice procedure.

Table 10-24: Sample sp_iqindexadvice output

Advice

NInst

LastDT

Add a CMP index on DBA.tb (c2, c3) Predicate: (tb.c2 = tb.c3)

2073

2006-04-07 16:37:31.000

Convert HG index on DBA.tb.c4 to a unique HG

812

2006-04-06 10:01:15.000

Join Key Columns DBA.ta.c1 and DBA.tb.c1 have mismatched data types

911

2006-02-25 20:59:01.000