https://delta.io logo
r

Roberto

01/30/2023, 11:33 AM
Good morning team! I have a question related to the z-order command. I execute Optimize once a day should I execute z-order once per day too? or z-order is only executed one time?
j

JosephK (exDatabricks)

01/30/2023, 12:22 PM
You do need to maintain the zordering of the table if you change it. Just scheduling z order is enough, you don’t need to optimize and then zorder because both will change your file layout.
r

Roberto

01/30/2023, 12:24 PM
So, executing once a day z-order will be enough, Do I?
j

JosephK (exDatabricks)

01/30/2023, 12:26 PM
Sure, just schedule it to run at like 2am and you should be fine
r

Roberto

01/30/2023, 12:26 PM
perfect! thanks!
Another question... can I execute z-order or an optimize in a table if I am executing a read, update, delete or merge in that table? I mean, can I execute both operations at the same time?
j

JosephK (exDatabricks)

01/30/2023, 2:46 PM
with a read won’t conflict, but it can cause concurrency issues with transactions
r

Roberto

01/30/2023, 3:37 PM
ummmm ok, understood. Thanks!
v

vijay

01/30/2023, 10:05 PM
Does z-order re-arrange the data across the files?
j

JosephK (exDatabricks)

01/31/2023, 10:25 AM
yes, it’s like a clustered write
4 Views