cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Analyze

Rajasaiharish
New Contributor III

 


How many types of analyze do we have for a UC delta table ? And how to check which type of ANALY

2 REPLIES 2

Rajasaiharish
New Contributor III


How many types of analyze do we have for a UC delta table ? And how to check which type of ANALYZE ran for what table? i think total questions was not printed correctly

Hello  @Rajasaiharish !

For a UC Delta table, there are three main ANALYZE command families:

  1. COMPUTE STATISTICS โ€” collects table/column statistics for the query optimiser.
  2. COMPUTE DELTA STATISTICS โ€” recomputes Delta file-level statistics used for data skipping.
  3. COMPUTE STORAGE METRICS โ€” calculates storage usage metrics.

There are three types of optimiser-stat collection sources, which you see on a UC delta table when ANALYZE is run:

  1. MANUAL_ANALYZE - Someone (notebook, SQL editor, job, DLT that isnโ€™t on the auto-stats write path) runs ANALYZE TABLE โ€ฆ COMPUTE STATISTICS.
  2. AUTO_STATS - Stats are collected on write / ingest, not manually.
  3. PREDICTIVE_ANALYZE  - Predictive Optimization (maintenance-auto-compute) schedules ANALYZE. 

You can run the query below to check the type of ANALYZE run on the table:

SHOW STATISTICS FROM catalog.schema.table AS JSON;
SHOW STATISTICS FROM catalog.schema.table FOR ALL COLUMNS AS JSON;

 

Look at statistics.collection_source and statistics.created_at in the output to see what type of ANALYZE was run on the table

Anudeep