sp_iqcardinality_analysis Procedure

Analyzes the cardinality of columns in a table.

Note: sp_iqcardinality_analysis no longer returns an index type value or index recommendation. Users are advised to Run Index Advisor for suggestions about additional column indexes. sp_iqcardinality_analysis is deprecated and will be removed in a future release.

Syntax

sp_iqcardinality_analysis ( [ ‘table_name’ ], [ ‘table_owner’ ], [ ‘script’ ] )

Parameters

Parameter

Description

table_name

Name of the table.

table_owner

Name of the table owner. If this parameter is not specified, then the procedure looks for a table owned by the current user.

script

The script :

  • table_name

  • table_owner

  • column_name

  • cardinality

  • index_type

  • index recommendation

Usage

If you do not specify any parameters, then SAP Sybase IQ displays create_index SQL statements for all columns in all tables owned by the current user.

If you specify script, you can redirect the output to generate the script file:

OUTPUT TO ‘indexfile.sql’ FORMAT ASCII QUOTE '';

Privileges

Requires be either table owner or have SELECT ANY TABLE system privilege. In addition, user must have at least ONE of the following: CREATE ANY INDEX, ALTER ANY INDEX, CREATE ANY OBJECT, or ALTER ANY OBJECT.

Example

sp_iqcardinality_analysis 'Departments', 'GROUPO'

table_name

table_owner

column_name

cardinality

index type

Index Recommendation

Departments

GROUPO

DepartmentID

5

Run Index Advisor

Departments

GROUPO

DepartmentName

5

Run Index Advisor

Departments

GROUPO

DepartmentHeadID

5

Run Index Advisor