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
Contributor

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
Databricks Employee
Databricks Employee

@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
Databricks Employee
Databricks Employee

@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

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโ€™t want to miss the chance to attend and share knowledge.

If there isnโ€™t a group near you, start one and help create a community that brings people together.

Request a New Group