cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

Is it more performant to run optimize table commands on a serverless SQL warehouse or elsewhere?

ac0
New Contributor III

Is it more performant to run optimize table commands on a serverless SQL warehouse or in a job or all-purpose compute cluster? I would presume a serverless warehouse would be faster, but I don't know how to test this.

1 ACCEPTED SOLUTION

Accepted Solutions

Yeshwanth
Honored Contributor
Honored Contributor

@ac0 Good day!

Serverless SQL warehouses are likely to execute "optimize table" commands faster than job or all-purpose compute clusters due to their rapid startup time, quick upscaling for low latency, and efficient handling of varying query demand. They also downscale quickly to minimize costs when demand is low. To compare execution speeds, set up a serverless SQL warehouse and a compute cluster with similar configurations. Run the "optimize table" command on the same table in both environments and measure the execution time. Repeat the test multiple times to get an average time. Finally, compare the average execution times to determine which is faster. Remember, actual performance can vary based on factors like specific configuration, resources, table size and complexity, and current system load and network conditions.

Good reads: 

1. https://docs.databricks.com/en/admin/sql/warehouse-types.html

2. https://docs.databricks.com/en/lakehouse-architecture/performance-efficiency/best-practices.html

Please let us know if you have any further queries or concerns.

Best regards,

Yesh

View solution in original post

2 REPLIES 2

-werners-
Esteemed Contributor III

I am not so sure a serverless cluster would be faster than a photon-enabled interactive/job cluster (assuming the same scale).
You could do a test with a deep clone of the table and apply optimize on both using different clusters.

Yeshwanth
Honored Contributor
Honored Contributor

@ac0 Good day!

Serverless SQL warehouses are likely to execute "optimize table" commands faster than job or all-purpose compute clusters due to their rapid startup time, quick upscaling for low latency, and efficient handling of varying query demand. They also downscale quickly to minimize costs when demand is low. To compare execution speeds, set up a serverless SQL warehouse and a compute cluster with similar configurations. Run the "optimize table" command on the same table in both environments and measure the execution time. Repeat the test multiple times to get an average time. Finally, compare the average execution times to determine which is faster. Remember, actual performance can vary based on factors like specific configuration, resources, table size and complexity, and current system load and network conditions.

Good reads: 

1. https://docs.databricks.com/en/admin/sql/warehouse-types.html

2. https://docs.databricks.com/en/lakehouse-architecture/performance-efficiency/best-practices.html

Please let us know if you have any further queries or concerns.

Best regards,

Yesh

Join 100K+ Data Experts: Register Now & Grow with Us!

Excited to expand your horizons with us? Click here to Register and begin your journey to success!

Already a member? Login and join your local regional user group! If there isn’t one near you, fill out this form and we’ll create one for you to join!