If we do z-order on a particular column will delta log stats collection be affected?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2023 08:42 AM
Let's assume a table contains more than 40 columns, now we know it automatically collects stat for the first 32 columns. If we run a z-order on a particular column(let's say column 1), then will the log file collect stats for all the 32 columns or will the log file collect stats for only 1st column w.r.t every file in the directory
- Labels:
-
Z-ordering

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2023 05:19 AM
@Shubhadip Ghosh : Hope this helps.
In Delta Lake, when you perform Z-Ordering on a particular column, it reorganizes the data within the files based on the values of that column. However, Z-Ordering itself does not directly affect the statistics collection process for other columns in the table.
By default, Delta Lake automatically collects statistics for the first 32 columns of a table to improve query performance. These statistics are stored in the Delta transaction log.
When you run Z-Ordering on a specific column, it reorganizes the data within the files according to that column's values, but it doesn't trigger automatic statistics collection for the other columns. The statistics collection remains unaffected by the Z-Ordering operation.

