Reply
amaaiia
Super User
Super User

OPTIMIZE VORDER for partitioned tables

Hi,

I have a lakehouse with some tables under Tables directory.

Some of the tables are partitioned by YEAR, MONTH, DAY, and other tables are not partitioned.

I've applied OPTIMIZE+VORDER to all the tables and I only see changes in the NOT partitioned tables. I see a new parquet file for theese tables, but partitioned tables have not changes in _delta_log directory nor new parquet file.

 

Why??

1 ACCEPTED SOLUTION
v-pbandela-msft
Community Support
Community Support

Hi @amaaiia,

Thank you for reaching out in Microsoft Community Forum.

The reason you’re not seeing changes in partitioned tables after running OPTIMIZE and VORDER is:

OPTIMIZE skips partitions that are already optimized, such as large or non-fragmented files.
VORDER only triggers changes if significant data reorganization is required.

please follow below steps to resolve this error;

1. please Check Partition Size using below code
DESCRIBE DETAIL delta.`/lakehouse_path/partitioned_table`

2.Force Optimization on Specific Partitions
OPTIMIZE delta.`/lakehouse_path/partitioned_table` WHERE YEAR = '2024'

3. Please Verify Optimization History
DESCRIBE HISTORY delta.`/lakehouse_path/partitioned_table`

Please continue using Microsoft community forum.

If you found this post helpful, please consider marking it as "Accept as Solution" and give it a 'Kudos'. if it was helpful. help other members find it more easily.

Regards,
Pavan.

View solution in original post

1 REPLY 1
v-pbandela-msft
Community Support
Community Support

Hi @amaaiia,

Thank you for reaching out in Microsoft Community Forum.

The reason you’re not seeing changes in partitioned tables after running OPTIMIZE and VORDER is:

OPTIMIZE skips partitions that are already optimized, such as large or non-fragmented files.
VORDER only triggers changes if significant data reorganization is required.

please follow below steps to resolve this error;

1. please Check Partition Size using below code
DESCRIBE DETAIL delta.`/lakehouse_path/partitioned_table`

2.Force Optimization on Specific Partitions
OPTIMIZE delta.`/lakehouse_path/partitioned_table` WHERE YEAR = '2024'

3. Please Verify Optimization History
DESCRIBE HISTORY delta.`/lakehouse_path/partitioned_table`

Please continue using Microsoft community forum.

If you found this post helpful, please consider marking it as "Accept as Solution" and give it a 'Kudos'. if it was helpful. help other members find it more easily.

Regards,
Pavan.

avatar user

Helpful resources

Announcements
FebFBC_Carousel

Fabric Monthly Update - February 2025

Check out the February 2025 Fabric update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)