@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