
For a multicolumn HG index in SAP IQ 16.1, check the SYSIDXCOL system view to see the actual index column order. Its sequence column starts at zero.
Query the index
Replace YOUR_HG_INDEX with the index name and run the query below. It joins the index columns to the table and column names, then sorts by the stored sequence.
SELECT systable.table_name,
sysindex.index_name,
syscolumn.column_name,
SYSIDXCOL.*
FROM SYSIDXCOL, sysindex, systable, syscolumn
WHERE SYSIDXCOL.table_id = sysindex.table_id
AND SYSIDXCOL.index_id = sysindex.index_id
AND systable.table_id = SYSIDXCOL.table_id
AND SYSIDXCOL.column_id = syscolumn.column_id
AND SYSIDXCOL.table_id = syscolumn.table_id
AND sysindex.index_name = 'YOUR_HG_INDEX'
ORDER BY SYSIDXCOL.sequence;Read the rows in sequence order. Check the returned table name as well, especially if the same index name exists on more than one table. The method applies to HG indexes backing multicolumn primary keys and to other multicolumn HG indexes.
Why column listings can mislead
The column-name lists returned by sp_iqindex and sp_iqhelp do not establish the multicolumn index order. Use the sequence from SYSIDXCOL when investigating how the index was defined.



