Advika
Community Manager
Community Manager

Hello @Sainath368!

Running ANALYZE TABLE <table_name> COMPUTE DELTA STATISTICS is a good practice after modifying data skipping stats columns on a Delta Lake table. However, this command doesn’t update query optimizer stats. For that, you’ll need to run ANALYZE TABLE <table_name> COMPUTE STATISTICS, which collects table and column-level statistics that help the query optimizer generate efficient query plans.

So, the recommended approach will be:

  • Use COMPUTE DELTA STATISTICS after changing data skipping columns or table properties.
  • Periodically, or after significant data changes, run COMPUTE STATISTICS to maintain accurate optimizer statistics.

If you’re using Unity Catalog-managed tables, consider enabling predictive optimization to automate statistics collection and related maintenance. Just note that this applies only to Unity Catalog-managed tables.