Alternatives to sorting

What if we don't need the data to be ordered?

  • Forming groups in GROUP BY (no ordering)

  • Removing duplicates in DISTINCT (no ordering)

Hashing is a better alternative in this scenario

  • Only need to remove duplicates, no need for ordering

  • Can be computationally cheaper than sorting

Last updated