# planner

Published articles for planner.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Waiting for PostgreSQL 19 - Add pg\_plan\_advice contrib module.

DevFeed: [Waiting for PostgreSQL 19 - Add pg\_plan\_advice contrib module.](<https://devfeed.tech/articles/waiting-for-postgresql-19-add-pg-plan-advice-contrib-module-33682.md>)

Original publisher: [Read original article](<https://www.depesz.com/2026/03/22/waiting-for-postgresql-19-add-pg_plan_advice-contrib-module/>)

Author: depesz

Published: 2026-03-22T13:44:10Z

Content type: tutorial

Language: en

Sources: [select \* from depesz;](<https://devfeed.tech/sources/select-from-depesz.md>)

Topics: [PostgreSQL](<https://devfeed.tech/topics/postgresql.md>), [systems](<https://devfeed.tech/topics/systems.md>)

Tags: [advice](<https://devfeed.tech/tags/advice.md>), [hint](<https://devfeed.tech/tags/hint.md>), [module](<https://devfeed.tech/tags/module.md>), [pg-plan-advice](<https://devfeed.tech/tags/pg-plan-advice.md>), [pg19](<https://devfeed.tech/tags/pg19.md>), [plan](<https://devfeed.tech/tags/plan.md>), [planner](<https://devfeed.tech/tags/planner.md>), [postgresql](<https://devfeed.tech/tags/postgresql.md>), [statistics](<https://devfeed.tech/tags/statistics.md>), [uncategorized](<https://devfeed.tech/tags/uncategorized.md>), [waiting](<https://devfeed.tech/tags/waiting.md>)

### AI overview

This article examines PostgreSQL's proposed pg_plan_advice contrib module, explaining why query planners sometimes choose suboptimal plans, how plan hints could stabilize or override those choices, and how to load and test the extension.

### Source excerpt

On 12nd of March 2026, Robert Haas committed patch: Add pg_plan_advice contrib module. Provide a facility that (1) can be used to stabilize certain plan choices so that the planner cannot reverse course without authorization and (2) can be used by knowledgeable users to insist on plan choices contrary to what the planner believes ... Continue reading "Waiting for PostgreSQL 19 - Add pg_plan_advice contrib module."

## Waiting for PostgreSQL 19 - Introduce the REPACK command

DevFeed: [Waiting for PostgreSQL 19 - Introduce the REPACK command](<https://devfeed.tech/articles/waiting-for-postgresql-19-introduce-the-repack-command-33681.md>)

Original publisher: [Read original article](<https://www.depesz.com/2026/03/19/waiting-for-postgresql-19-introduce-the-repack-command/>)

Author: depesz

Published: 2026-03-19T18:07:59Z

Content type: article

Language: en

Sources: [select \* from depesz;](<https://devfeed.tech/sources/select-from-depesz.md>)

Topics: [PostgreSQL](<https://devfeed.tech/topics/postgresql.md>), [postgresql clusters](<https://devfeed.tech/topics/postgresql-clusters.md>)

Tags: [analyze](<https://devfeed.tech/tags/analyze.md>), [bloat](<https://devfeed.tech/tags/bloat.md>), [command](<https://devfeed.tech/tags/command.md>), [indexes](<https://devfeed.tech/tags/indexes.md>), [locking](<https://devfeed.tech/tags/locking.md>), [maintenance](<https://devfeed.tech/tags/maintenance.md>), [pg-repack](<https://devfeed.tech/tags/pg-repack.md>), [pg19](<https://devfeed.tech/tags/pg19.md>), [planner](<https://devfeed.tech/tags/planner.md>), [postgresql](<https://devfeed.tech/tags/postgresql.md>), [repack](<https://devfeed.tech/tags/repack.md>), [uncategorized](<https://devfeed.tech/tags/uncategorized.md>), [vacuum](<https://devfeed.tech/tags/vacuum.md>), [waiting](<https://devfeed.tech/tags/waiting.md>)

### AI overview

The article examines PostgreSQL 19's proposed built-in REPACK command, which combines functionality associated with VACUUM FULL and CLUSTER. It demonstrates reclaiming space and reordering a table, discusses locking because concurrent operation is not yet supported, and introduces the pg_stat_progress_repack progress view and available command forms.

### Source excerpt

On 10th of March 2026, Álvaro Herrera committed patch: Introduce the REPACK command REPACK absorbs the functionality of VACUUM FULL and CLUSTER in a single command. Because this functionality is completely different from regular VACUUM, having it separate from VACUUM makes it easier for users to understand; as for CLUSTER, the term is heavily ... Continue reading "Waiting for PostgreSQL 19 - Introduce the REPACK command"

## SQLite Query Optimisation - How the Planner Thinks and Where It Goes Wrong

DevFeed: [SQLite Query Optimisation - How the Planner Thinks and Where It Goes Wrong](<https://devfeed.tech/articles/sqlite-query-optimisation-how-the-planner-thinks-and-where-it-goes-wrong-39650.md>)

Original publisher: [Read original article](<https://www.gauravsarma.com/posts/2026-03-08_sqlite-query-optimisation>)

Published: 2026-03-08T00:00:00Z

Content type: tutorial

Language: en

Sources: [Gaurav Sarma's Blog](<https://devfeed.tech/sources/gaurav-sarma-s-blog.md>)

Topics: [SQLite](<https://devfeed.tech/topics/sqlite.md>), [SQL](<https://devfeed.tech/topics/sql.md>), [Databases](<https://devfeed.tech/topics/databases.md>)

Tags: [b-tree](<https://devfeed.tech/tags/b-tree.md>), [index](<https://devfeed.tech/tags/index.md>), [optimisation](<https://devfeed.tech/tags/optimisation.md>), [planner](<https://devfeed.tech/tags/planner.md>), [query](<https://devfeed.tech/tags/query.md>), [query-planner](<https://devfeed.tech/tags/query-planner.md>), [sql](<https://devfeed.tech/tags/sql.md>), [sqlite](<https://devfeed.tech/tags/sqlite.md>)

### AI overview

A tutorial on how SQLite's query planner chooses between index searches and full table scans. It explains planner behavior, the effects of query patterns and data distribution, and how to avoid conditions that make indexes inaccessible or scans appear cheaper.

### Source excerpt

. [SQLite Query Optimisation](sqlite-query-optimisation-cover...

## pg\_plan\_advice: Plan Stability and User Planner Control for PostgreSQL?

DevFeed: [pg\_plan\_advice: Plan Stability and User Planner Control for PostgreSQL?](<https://devfeed.tech/articles/pg-plan-advice-plan-stability-and-user-planner-control-for-postgresql-33636.md>)

Original publisher: [Read original article](<https://rhaas.blogspot.com/2026/03/pgplanadvice-plan-stability-and-user.html>)

Author: Robert Haas (noreply@blogger.com)

Published: 2026-03-04T17:55:00Z

Content type: opinion

Language: en

Sources: [Robert Haas](<https://devfeed.tech/sources/robert-haas.md>)

Topics: [PostgreSQL](<https://devfeed.tech/topics/postgresql.md>), [JOIN](<https://devfeed.tech/topics/join.md>), [modules](<https://devfeed.tech/topics/modules.md>), [Query (disambiguation)](<https://devfeed.tech/topics/query.md>)

Tags: [join](<https://devfeed.tech/tags/join.md>), [modules](<https://devfeed.tech/tags/modules.md>), [plan](<https://devfeed.tech/tags/plan.md>), [planner](<https://devfeed.tech/tags/planner.md>), [postgresql](<https://devfeed.tech/tags/postgresql.md>), [query](<https://devfeed.tech/tags/query.md>), [test](<https://devfeed.tech/tags/test.md>)

### AI overview

The article presents a proposed PostgreSQL 19 patch set introducing the pg_plan_advice, pg_collect_advice, and pg_stash_advice contrib modules. It demonstrates how pg_plan_advice can generate plan advice strings, preserve selected planner decisions, or vary advice to produce a different join plan.

### Source excerpt

I'm proposing a very ambitious patch set for PostgreSQL 19. Only time will tell whether it ends up in the release, but I can't resist using this space to give you a short demonstration of what it can do. The patch set introduces three new contrib modules, currently called pg_plan_advice, pg_collect_advice, and pg_stash_advice. Read more "

## Nordic PostgreSQL Day 2015

DevFeed: [Nordic PostgreSQL Day 2015](<https://devfeed.tech/articles/nordic-postgresql-day-2015-34636.md>)

Original publisher: [Read original article](<https://tapoueh.org/conf/nordic-postgresql-day-2015/>)

Published: 2015-03-16T14:50:00Z

Content type: article

Language: en

Sources: [Dimitri Fontaine](<https://devfeed.tech/sources/dimitri-fontaine.md>)

Topics: [PostgreSQL](<https://devfeed.tech/topics/postgresql.md>), [SQL](<https://devfeed.tech/topics/sql.md>), [Open Source](<https://devfeed.tech/topics/open-source.md>)

Tags: [developers](<https://devfeed.tech/tags/developers.md>), [internals](<https://devfeed.tech/tags/internals.md>), [jsonb](<https://devfeed.tech/tags/jsonb.md>), [learn](<https://devfeed.tech/tags/learn.md>), [open-source](<https://devfeed.tech/tags/open-source.md>), [planner](<https://devfeed.tech/tags/planner.md>), [postgresql](<https://devfeed.tech/tags/postgresql.md>), [sql](<https://devfeed.tech/tags/sql.md>), [window-functions](<https://devfeed.tech/tags/window-functions.md>)

### AI overview

Nordic PostgreSQL Day 2015 is presented as a conference opportunity for developers and PostgreSQL users. The featured PostgreSQL for Developers talk covers solving a use case in SQL, SQL window functions, ranges, JSONB capabilities, and query planner internals.

### Source excerpt

The PostgreSQL for Developers talk begins with a simple use case for developers to solve entirely in SQL. Discover SQL window functions if you don't know them already, and then see about advanced PostgreSQL stuff such as ranges.

## Finding plans in pg\_stat\_plans easily with pg\_find\_plans

DevFeed: [Finding plans in pg\_stat\_plans easily with pg\_find\_plans](<https://devfeed.tech/articles/finding-plans-in-pg-stat-plans-easily-with-pg-find-plans-33647.md>)

Original publisher: [Read original article](<https://pgeoghegan.blogspot.com/2012/12/finding-plans-in-pgstatplans-easily.html>)

Author: Peter Geoghegan (noreply@blogger.com)

Published: 2012-12-04T10:40:00Z

Content type: article

Language: en

Sources: [Peter Geoghegan's blog](<https://devfeed.tech/sources/peter-geoghegan-s-blog.md>)

Topics: [PostgreSQL](<https://devfeed.tech/topics/postgresql.md>), [Databases](<https://devfeed.tech/topics/databases.md>), [SQL](<https://devfeed.tech/topics/sql.md>), [JSON](<https://devfeed.tech/topics/json.md>), [Python](<https://devfeed.tech/topics/python.md>), [Monitoring](<https://devfeed.tech/topics/monitoring.md>)

Tags: [join](<https://devfeed.tech/tags/join.md>), [json](<https://devfeed.tech/tags/json.md>), [pg-stat-plans](<https://devfeed.tech/tags/pg-stat-plans.md>), [pg-stat-statements](<https://devfeed.tech/tags/pg-stat-statements.md>), [planner](<https://devfeed.tech/tags/planner.md>), [postgresql](<https://devfeed.tech/tags/postgresql.md>), [python](<https://devfeed.tech/tags/python.md>), [sql](<https://devfeed.tech/tags/sql.md>)

### AI overview

The article introduces pg_find_plans, an experimental pg_stat_plans submodule for PostgreSQL. It uses machine-readable EXPLAIN output to search stored execution plans by criteria such as sequential scans, execution costs, and join counts directly from SQL. The article also discusses its PL/Python and PL/pgSQL implementation, input sanitization, limitations, and the usefulness of JSON for representing plan structures.

### Source excerpt

As I recently blogged about, pg_stat_plans is a PostgreSQL satellite project I've been working on that aims to support earlier versions of Postgres that cannot use the new pg_stat_statements, and to track execution costs at the plan rather than the query granularity. It allows the user to easily explain each stored query text to see the plan for the entry, and has features that facilitate monitoring planner regressions. Since PostgreSQL 9.0, support for machine-readable EXPLAIN output has existed. I'm not aware that anyone else got around to actually doing something interesting with this capability, though. I knew that in order to get the most benefit from pg_stat_plans, it ought to be possible to leverage this capability to search for plans based on arbitrary criteria, directly from SQL. I've written an experimental submodule of pg_stat_plans, called pg_find_plans, that is designed to do just that - to quickly find plans and their execution costs, for those plans that, say, perform a sequential scan on a known large table. Here's the description of pg_find_plans from its documentation: pg_find_plans is written in PL/Python and PL/PgSQL. It is intended to provide users with a better way to ask questions like "what are the execution costs of all plans tracked since last statistics reset that involve a sequential scan against mytable, and have more than 2 joins?". That might be written as: mydb=# select join_count(json_plan), p.* from pg_stat_plans p join stored_plans sp on (p.userid=sp.userid and p.dbid=sp.dbid and p.planid=sp.planid) where from_our_database and join_count(json_plan) > 2 and contains_node(json_plan, 'Seq Scan', 'mytable'); order by 1 desc nulls last; Users should have a high degree of confidence that their queries on plan's structure are free of detectable errors, and pg_find_plans ensures this by carefully sanitising user input. For example, if the node of interest was specified as 'seq scan' above, the query would raise an error - to do any less mi

## First release of pg\_stat\_plans

DevFeed: [First release of pg\_stat\_plans](<https://devfeed.tech/articles/first-release-of-pg-stat-plans-33645.md>)

Original publisher: [Read original article](<https://pgeoghegan.blogspot.com/2012/10/first-release-of-pgstatplans.html>)

Author: Peter Geoghegan (noreply@blogger.com)

Published: 2012-10-20T14:53:00Z

Content type: release

Language: en

Sources: [Peter Geoghegan's blog](<https://devfeed.tech/sources/peter-geoghegan-s-blog.md>)

Topics: [PostgreSQL](<https://devfeed.tech/topics/postgresql.md>), [Databases](<https://devfeed.tech/topics/databases.md>), [SQL](<https://devfeed.tech/topics/sql.md>), [Open Source](<https://devfeed.tech/topics/open-source.md>), [Logging](<https://devfeed.tech/topics/logging.md>)

Tags: [database](<https://devfeed.tech/tags/database.md>), [open-source](<https://devfeed.tech/tags/open-source.md>), [performance](<https://devfeed.tech/tags/performance.md>), [pg-stat-plans](<https://devfeed.tech/tags/pg-stat-plans.md>), [pg-stat-statements](<https://devfeed.tech/tags/pg-stat-statements.md>), [planner](<https://devfeed.tech/tags/planner.md>), [postgresql](<https://devfeed.tech/tags/postgresql.md>), [query](<https://devfeed.tech/tags/query.md>), [release](<https://devfeed.tech/tags/release.md>), [sql](<https://devfeed.tech/tags/sql.md>)

### AI overview

The article announces the first release of pg_stat_plans, an open-source PostgreSQL module based on pg_stat_statements. It analyzes plan execution costs and planner regressions, extends normalized-statement analysis to PostgreSQL 9.0 and 9.1, and tracks plan costs over time.

### Source excerpt

Anyone who attended my recent talk at Postgres Open, which was co-presented with my 2ndQuadrant colleague Greg Smith, "Beyond Query Logging", will be aware that pg_stat_statements, the standard contrib module that assigns execution costs to queries and makes them available from a view in the database, has been improved considerably in the recent 9.2 Postgres release. It has been improved in a way that we believe will alter the preferred approach to workload analysis on PostgreSQL databases away from log analysis tools, which just don't offer the performance, flexibility or granularity of this new approach. We also announced a new open source tool that addresses a related but slightly different problem (the analysis of plan execution costs, and planner regressions), as well as making most of the benefits of pg_stat_statements on 9.2 available to users stuck on earlier versions of Postgres. This new tool is called pg_stat_plans, and is itself based on pg_stat_statements. The 9.2 pg_stat_statements feature of particular importance, the ability to "normalise" non-prepared statements that the large majority of applications use exclusively is now brought to earlier versions (versions 9.0 and 9.1, though pg_stat_plans works fine on 9.2 too). Since pg_stat_plans fingerprints plans rather than query trees, the way this works is slightly different to pg_stat_statements, and perhaps doesn't quite match people's intuitive expectations about how normalisation ought to behave in some cases. These differences have been extensively documented. pg_stat_plans also has the ability to EXPLAIN a stored, representative SQL text, in order to facilitate deeper analysis of plan execution costs. Plan total_cost and startup_cost is tracked over time for each plan, for example, so that the "crossover point" at which the planner begins to prefer an alternative plan can sometimes be observed, and the planner's "reasoning" can perhaps be better understood. pg_stat_plans is distributed under the P