4 bookmarks for 2023-11-15

Sort-merge joins do not need indexes on the join predicates.
MySQL does not support sort-merge joins at all.

# sql
417.

Index the independent where predicates to improve hash join performance.

Indexing join predicates doesn’t improve hash join performance.

Indexing a hash join is independent of the join order.

Select fewer columns to improve hash join performance.

Hash joins do not need indexes on the join predicates. They use the hash table instead.
A hash join uses indexes only if the index supports the independent predicates.
Reduce the hash table size to improve performance; either horizontally (less rows) or vertically (less columns).
Hash joins cannot perform joins that have range conditions in the join predicates.

# sql
416.

Avoid LIKE expressions with leading wildcards (e.g., '%TERM').

# sql
415.

Rule of thumb: index for equality first—then for ranges.

# sql
414.