PostgreSQL Internals & Planner
Query Planner
Statistics
Join Methods
- Nested Loop: Fast for small data sets or when using indexes on the inner table.
- Hash Join: Most common for larger sets. Hash table built in memory.
- Merge Join: Efficient for large, pre-sorted data sets.
Scan Methods
- Seq Scan: Sequential table scan.
- Index Scan: Lookup via B-Tree/Hash etc.
- Bitmap Scan: Combine index results (BitmapAnd/Or) before visiting heap.