Tracking Teradata Statistics Usage with StatUseCountV

How to find out if the Teradata Statistics we created for a specific workload are used?

Teradata statistics greatly affect SQL query efficiency.

We need a reliable method to get this information.

Various objects, such as tables and join indexes, can have statistics collected on them. As performance tuners, it is important to confirm their usage since collecting unnecessary statistics can lead to excessive resource consumption.

The Solution: Logging the Detailed Information with StatUseCountV

Teradata enables precise information retrieval by activating DBQL UseCount logging and StatsUsage logging.

To conserve resources, it is advisable to activate USECOUNT logging only for analysis purposes on specific databases rather than for all of them.

Enabling the logging for StatUseCountV and Object Use Counts

We only enable logging for our test database DWHPRO.

-- EnableUse Counts on database DWHPRO only
BEGIN QUERY LOGGING WITH USECOUNT ON DWHPRO;

-- Enable StatsUsage Logging for user DWHPRO_ADMIN
BEGIN QUERY LOGGING WITH STATSUSAGE ON DWHPRO_ADMIN;

StatsUsage logging cannot be defined at the database level, and any such attempt will result in an error.

BEGIN QUERY LOGGING WITH STATSUSAGE ON DWHPRO;

REPLACE QUERY LOGGING Failed.  [3706] Syntax error: Only USECOUNT option allowed with databases.

Example Query with Statistics Logging

Below is an example of how to identify statistics usage in the DBC.StatUseCountV view:


COLLECT STATISTICS COLUMN(a) ON DWHPRO.StatisticsExample;

SELECT * FROM  DWHPRO.StatisticsExample
WHERE a = 1;

SELECT * FROM dbc.StatUseCountV;
Teradata StatUseCountV

Related Services

⚡ Need Help Optimizing Your Data Platform?

We cut data platform costs by 30–60% without hardware changes. 25+ years of hands-on tuning experience.

Explore Our Services →

🔧 Need Expert Database Administration?

Our team brings 25+ years of enterprise DBA experience across Teradata, Snowflake, and Oracle.

Meet Our Team →

📊 Data Platform Migration Survey

Help us map where the industry is heading. Results are public — see what others chose.

1. What is your current data platform?

2. Where are you migrating to (or evaluating)?

Migrating FROM
Migrating TO

Thanks for voting! Share this with your network.

Follow me on LinkedIn for daily insights on data warehousing and platform migrations.

Stay Ahead in Data Warehousing

Get expert insights on Teradata, Snowflake, BigQuery, Databricks, Microsoft Fabric, and modern data architecture — delivered to your inbox.

Leave a Comment

DWHPro

Expert network for enterprise data platforms. Senior consultants, project teams built for your challenge — across Teradata, Snowflake, Databricks, and more.

📍Vienna, Austria & Jacksonville, Florida

Quick Links
Services Team Teradata Book Blog Contact Us
Connect
LinkedIn → [email protected]
Newsletter

Join 4,000+ data professionals.
Weekly insights on Teradata, Snowflake & data architecture.