About cookies on this site Our websites require some cookies to function properly (required). In addition, other cookies may be used with your consent to analyze site usage, improve the user experience and for advertising. For more information, please review your options. By visiting our website, you agree to our processing of information as described in IBM’sprivacy statement. To provide a smooth navigation, your cookie preferences will be shared across the IBM web domains listed here.
Last updated: Nov 26, 2024
You can use SQL to determine whether statistics for a specific virtual table are missing.
To determine whether table-level statistics are missing for a virtual table, use the following query.
select cast(TABNAME as varchar(25)), TYPE, COLCOUNT, STATS_TIME
from SYSCAT.TABLES
where TABSCHEMA='schema'
and CARD=-1;
Replace schema with the schema name of the virtual table. The statement returns a list of all the objects in the schema that have a CARD value of -1, which is an indication that table-level statistics have not been collected.
To determine whether column-level statistics are missing for a virtual table, use the following query.
select cast (COLNAME as varchar(25))
from SYSSTAT.COLUMNS
where TABSCHEMA='schema'
and TABNAME='table_name'
and COLCARD=-1
and NUMNULLS=-1;
Replace schema with the schema name and table_name with the name of the virtual table. The statement returns a list of all the objects in the schema that have a COLCARD and NUMNULLS value of -1, which is an indication that column-level statistics have not been collected.
Note: Not all columns in a table require column-level statistics.
Was the topic helpful?
0/1000