Satya Kuppam
12/19/2025, 6:13 PMORDER BY starts with the highest cardinality column. General advise is to ORDER BY your columns based on cardinality from lowest to highest, if I do this what is the impact on JOIN performance on the high cardinality column? I am co-locating the join tables on the highest cardinality column.
My intuition is joins will be faster if the highest cardinality column (i.e join column) is sorted first due to reduction in random access. This might reduce compression but if joins are a majority of our queries then the trade off might be worth it?