Re: pg_plan_advice
Jacob Champion <jacob.champion@enterprisedb.com>
From: Jacob Champion <jacob.champion@enterprisedb.com>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Dian Fay <di@nmfay.com>, Matheus Alcantara <matheusssilv97@gmail.com>, Jakub Wartak <jakub.wartak@enterprisedb.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-12-12T18:09:44Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Add pg_plan_advice contrib module.
- 5883ff30b02c 19 (unreleased) landed
-
Store information about Append node consolidation in the final plan.
- 7358abcc6076 19 (unreleased) landed
-
Store information about elided nodes in the final plan.
- 0d4391b265f8 19 (unreleased) landed
-
Store information about range-table flattening in the final plan.
- adbad833f3d9 19 (unreleased) landed
-
Allow for plugin control over path generation strategies.
- 4020b370f214 19 (unreleased) landed
-
Allow passing a pointer to GetNamedDSMSegment()'s init callback.
- 48d4a1423d2e 19 (unreleased) cited
-
Don't reset the pathlist of partitioned joinrels.
- 014f9a831a32 19 (unreleased) cited
On Fri, Dec 12, 2025 at 9:36 AM Robert Haas <robertmhaas@gmail.com> wrote: > At least for me, setting pg_plan_advice.advice to any of these strings > does not provoke a crash. What I discovered after a bit of > experimentation is that you get the crash if you (a) set the string to > something like this and then (b) run an EXPLAIN. Makes sense (this fuzzer was exercising pgpa_format_advice_target()). > > With USE_ASSERT_CHECKING, that should help, but I'm not sure if it > > does without. (I could have sworn there was a conversation about that > > at some point but I can't remember any of the keywords.) Could also > > just make a dummy assignment. Or tag pg_plan_advice_dsa_area() with > > __attribute__((returns_nonnull)), but that's more portability work. > > As in initialize ca_pointer to InvalidDsaPointer? Yeah. Next bit of fuzzer feedback: I need the following diff in pgpa_trove_add_to_hash() to avoid a crash when the hashtable starts to fill up: > element = pgpa_trove_entry_insert(hash, key, &found); > + if (!found) > + element->indexes = NULL; > element->indexes = bms_add_member(element->indexes, index); The advice string that triggered this is horrific, but I can send it to you offline if you're morbidly curious. (I can spend time to minimize it or I can get more fuzzer coverage, and I'd rather do the latter right now :D) --Jacob