cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
cancel
Showing results for 
Search instead for 
Did you mean: 

If we do z-order on a particular column will delta log stats collection be affected?

shubhadip
New Contributor

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 

1 REPLY 1

Anonymous
Not applicable

@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.

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.