Setting the file. One moment.
Subchapter 74.15
references/upgrade-query-load-postgresql.mdMarkdown2 KBView on GitHub
References
Bluegreen Advisor WorkflowSELECT queryid, query, calls, total_exec_time::numeric(12,2) AS total_time_ms,
mean_exec_time::numeric(12,2) AS avg_time_ms,
rows, shared_blks_hit, shared_blks_read
FROM pg_stat_statements
WHERE dbid = (SELECT oid FROM pg_database WHERE datname = current_database())
ORDER BY total_exec_time DESC LIMIT 5;EXPLAIN (ANALYZE, BUFFERS, FORMAT JSON) <query>;For data-modifying queries, wrap in a transaction and rollback.
| Pattern | Versions | Action |
|---|---|---|
Sort Method: external merge | PG 15+ | work_mem per-operation accounting changed. Tune work_mem and hash_mem_multiplier. |
HashAggregate with Batches > 1 | PG 15+ | Memory accounting different. Adjust work_mem. |
| JIT on short queries | PG 14+ | JIT overhead causes latency spikes. Adjust jit_above_cost thresholds. |
| Pattern | Versions | Action |
|---|---|---|
| Nested Loop without Memoize | PG 14+ | PG 14 introduced Memoize. Usually beneficial. Set enable_memoize=off if regression. |
| Parallel scan threshold changes | PG 14-16 | Plans may gain/lose parallelism. Compare on test instance. |
| Merge Join on large tables | PG 16+ | Improved costing may change join strategy. Benchmark. |
| Pattern | Notes |
|---|---|
| Simple Index Scan / Index Only Scan | Stable across versions. |
| Seq Scan on small tables | No change. |