Gathering statistics about Datalake tables

You can use the ANALYZE TABLE statement to gather statistics for Datalake tables. These statistics are used by the Db2® optimizer to determine the most optimal access plans to efficiently process your queries. The more statistics that you collect on your tables, the better decisions the optimizer can make to provide the best possible access plans. When you run the ANALYZE TABLE statement on a table to collect these statistics, the query generally runs faster.

You can use the auto-analyze feature to automatically determine whether a table should be analyzed. If you add new data, or if you have never run the ANALYZE TABLE statement against a table, auto-analyze schedules an analyze operation. For more information, see Auto-analyze.