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

Privileges

You must have EXECUTE privilege on the system procedure. You must also have one of the following:
  • SELECT ANY TABLE system privilege
  • You own the table
In addition, you must also have at least ONE of the following system privileges:
  • CREATE ANY INDEX
  • ALTER ANY INDEX
  • CREATE ANY OBJECT
  • ALTER ANY OBJECT

Remarks

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 '';

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

Related reference
Determining the Security Model Used by a Database