git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: f37ff03) | patch
Fix EXPLAIN (SETTINGS) to follow policy about when to print empty fields.
2020年1月26日 21:31:48 +0000 (16:31 -0500)
2020年1月26日 21:32:19 +0000 (16:32 -0500)
commit 3ec20c7091e97a554e7447ac2b7f4ed795631395
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
src/backend/commands/explain.c diff | blob | blame | history
src/backend/utils/misc/guc.c diff | blob | blame | history
src/test/regress/expected/explain.out diff | blob | blame | history
src/test/regress/sql/explain.sql diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /