4 bookmarks for 2023-11-15

417.

Sort-Merge Join in SQL databases: Oracle, SQL Server, PostgreSQL

use-the-index-luke.com/sql/join/sort-merge-join

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

416.

Partial Objects in ORMs: loading a subset of properties

use-the-index-luke.com/sql/join/hash-join-partial-objects

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.

415.

Tuning SQL LIKE using indexes

use-the-index-luke.com/sql/where-clause/searching-for-ranges/like-performance-tuning

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

414.

Indexing SQL range conditions less than, greater than and between

use-the-index-luke.com/sql/where-clause/searching-for-ranges/greater-less-between-tuning-sql-access-filter-predicates

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