A correct query and a fast query are separate goals. Partition pruning can reduce files read when the layout and filters fit. Too many small files add overhead. OPTIMIZE compacts files, and ZORDER can colocate related values for supported layouts. Liquid Clustering and predictive optimization offer other layout-management choices; review their supported table types and operational behavior.
This browser keeps rows locally. Its OPTIMIZE, ZORDER and VACUUM outputs are labeled simulations, so their runtime is not evidence of a production speedup. In a real workload, compare input size and Spark stage metrics before and after a change. Shuffle, skew and spill describe different bottlenecks. Tune one justified setting at a time, including shuffle partitions, broadcast thresholds or memory, and remeasure against a comparable baseline. More compute does not fix an incorrect join or a duplicated business grain.