agora inbox for pgsql-committers@postgresql.org  
help / color / mirror / Atom feed
From: Robert Haas <rhaas@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add pg_stash_advice contrib module.
Date: Mon, 06 Apr 2026 11:57:03 +0000
Message-ID: <E1w9iZi-003Ds0-1z@gemulon.postgresql.org> (raw)

Add pg_stash_advice contrib module.

This module allows plan advice strings to be provided automatically
from an in-memory advice stash. Advice stashes are stored in dynamic
shared memory and must be recreated and repopulated after a server
restart. If pg_stash_advice.stash_name is set to the name of an advice
stash, and if query identifiers are enabled, the query identifier
for each query will be looked up in the advice stash and the
associated advice string, if any, will be used each time that query
is planned.

Reviewed-by: Lukas Fittl <lukas@fittl.com>
Reviewed-by: Alexandra Wang <alexandra.wang.oss@gmail.com>
Reviewed-by: David G. Johnston <david.g.johnston@gmail.com>
Reviewed-by: Jakub Wartak <jakub.wartak@enterprisedb.com>
Discussion: http://postgr.es/m/CA+TgmoaeNuHXQ60P3ZZqJLrSjP3L1KYokW9kPfGbWDyt+1t=Ng@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/e8ec19aa321abc89fb4fd277c994f14680ba17db

Modified Files
--------------
contrib/Makefile                                   |   1 +
contrib/meson.build                                |   1 +
contrib/pg_stash_advice/Makefile                   |  27 +
.../pg_stash_advice/expected/pg_stash_advice.out   | 331 +++++++++++
.../expected/pg_stash_advice_utf8.out              |  16 +
.../expected/pg_stash_advice_utf8_1.out            |   8 +
contrib/pg_stash_advice/meson.build                |  37 ++
contrib/pg_stash_advice/pg_stash_advice--1.0.sql   |  43 ++
contrib/pg_stash_advice/pg_stash_advice.c          | 605 +++++++++++++++++++++
contrib/pg_stash_advice/pg_stash_advice.control    |   5 +
contrib/pg_stash_advice/pg_stash_advice.h          |  99 ++++
contrib/pg_stash_advice/sql/pg_stash_advice.sql    | 150 +++++
.../pg_stash_advice/sql/pg_stash_advice_utf8.sql   |  16 +
contrib/pg_stash_advice/stashfuncs.c               | 306 +++++++++++
doc/src/sgml/contrib.sgml                          |   1 +
doc/src/sgml/filelist.sgml                         |   1 +
doc/src/sgml/pgstashadvice.sgml                    | 216 ++++++++
src/tools/pgindent/typedefs.list                   |   6 +
18 files changed, 1869 insertions(+)



Message-ID: <E1w9iZi-003Ds0-1z@gemulon.postgresql.org>
Permalink:  ../E1w9iZi-003Ds0-1z@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1w9iZi-003Ds0-1z@gemulon.postgresql.org

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: rhaas@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Add pg_stash_advice contrib module.
  In-Reply-To: <E1w9iZi-003Ds0-1z@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox