No Picture
PostgreSQL Internals

PostgreSQL Query Optimizer: Troubleshooting Unconsidered Hints

PostgreSQL’s query optimizer (or planner) creates optimal execution plans for SQL queries by evaluating multiple possible plans and selecting the fastest one. [^1] Understanding PostgreSQL’s Approach to Optimizer Hints PostgreSQL takes a deliberately cautious approach […]
No Picture
PostgreSQL Internals

How to have PostgreSQL execution plan with run-time?

PostgreSQL execution plan with run-time In PostgreSQL, you can obtain the execution plan with runtime information using the EXPLAIN (ANALYZE, VERBOSE) command. This command in particular, provides a detailed execution plan along with actual runtime […]
No Picture
PostgreSQL Performance

Adaptive Joins PostgreSQL: Improving Query Performance

Introduction: Adaptive joins are an exciting feature in PostgreSQL. They dynamically adjust the join method during query execution to optimize performance. This article explores adaptive joins in PostgreSQL, their benefits, and how they can improve […]
No Picture
PostgreSQL Internals

PostgreSQL Aggregation and Spools: Implementing Plans

In PostgreSQL, plans are implemented by using the query execution plan generated by the query optimizer. Aggregation and spool operations serve as key components in query plans, enabling efficient processing of aggregate queries. Let’s now […]
No Picture
PostgreSQL Performance

Troubleshooting PostgreSQL Query Performance

Monitoring query latency, wait events, and locks in PostgreSQL helps identify and diagnose performance bottlenecks. Here’s a guide on how to monitor these aspects: Here’s a sample query to gather information about locks, wait events, […]