pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix EXPLAIN (SETTINGS) to follow policy about when to print empt
2+ messages / 1 participants
[nested] [flat]

* pgsql: Fix EXPLAIN (SETTINGS) to follow policy about when to print empt
@ 2020-01-26 21:32 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2020-01-26 21:32 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix EXPLAIN (SETTINGS) to follow policy about when to print empty fields.

In non-TEXT output formats, the "Settings" field should appear when
requested, even if it would be empty.

Also, get rid of the premature optimization of counting all the
GUC_EXPLAIN variables at startup.  Since there was no provision for
adjusting that count later, all it'd take would be some extension marking
a parameter as GUC_EXPLAIN to risk an assertion failure or memory stomp.
We could make get_explain_guc_options() count those variables on-the-fly,
or dynamically resize its array ... but TBH I do not think that making a
transient array of pointers a bit smaller is worth any extra complication,
especially when you consider all the other transient space EXPLAIN eats.
So just allocate that array at the max possible size.

In HEAD, also add some regression test coverage for this feature.

Because of the memory-stomp hazard, back-patch to v12 where this
feature was added.

Discussion: https://postgr.es/m/19416.1580069629@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/3ec20c7091e97a554e7447ac2b7f4ed795631395

Modified Files
--------------
src/backend/commands/explain.c        | 18 +++++-------
src/backend/utils/misc/guc.c          | 54 ++++++++++-------------------------
src/test/regress/expected/explain.out | 20 +++++++++++++
src/test/regress/sql/explain.sql      | 12 ++++++++
4 files changed, 54 insertions(+), 50 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* pgsql: Fix EXPLAIN (SETTINGS) to follow policy about when to print empt
@ 2020-01-26 21:32 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2020-01-26 21:32 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix EXPLAIN (SETTINGS) to follow policy about when to print empty fields.

In non-TEXT output formats, the "Settings" field should appear when
requested, even if it would be empty.

Also, get rid of the premature optimization of counting all the
GUC_EXPLAIN variables at startup.  Since there was no provision for
adjusting that count later, all it'd take would be some extension marking
a parameter as GUC_EXPLAIN to risk an assertion failure or memory stomp.
We could make get_explain_guc_options() count those variables on-the-fly,
or dynamically resize its array ... but TBH I do not think that making a
transient array of pointers a bit smaller is worth any extra complication,
especially when you consider all the other transient space EXPLAIN eats.
So just allocate that array at the max possible size.

In HEAD, also add some regression test coverage for this feature.

Because of the memory-stomp hazard, back-patch to v12 where this
feature was added.

Discussion: https://postgr.es/m/19416.1580069629@sss.pgh.pa.us

Branch
------
REL_12_STABLE

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

Modified Files
--------------
src/backend/commands/explain.c | 18 ++++++--------
src/backend/utils/misc/guc.c   | 54 ++++++++++++------------------------------
2 files changed, 22 insertions(+), 50 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2020-01-26 21:32 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-01-26 21:32 pgsql: Fix EXPLAIN (SETTINGS) to follow policy about when to print empt Tom Lane <tgl@sss.pgh.pa.us>
2020-01-26 21:32 pgsql: Fix EXPLAIN (SETTINGS) to follow policy about when to print empt Tom Lane <tgl@sss.pgh.pa.us>

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