aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/explain.c
diff options
context:
space:
mode:
authorDavid Rowley <drowley@postgresql.org>2025-03-21 13:40:05 +1300
committerDavid Rowley <drowley@postgresql.org>2025-03-21 13:40:05 +1300
commit00b52c3db66c5ec2593463c43371525deff95347 (patch)
treed3b54721ddb828ae8c1440849a25946da2602182 /src/backend/commands/explain.c
parent202b12774d092baf7e5d3309aa3cb0cd1e8a606b (diff)
downloadpostgresql-00b52c3db66c5ec2593463c43371525deff95347.tar.gz
postgresql-00b52c3db66c5ec2593463c43371525deff95347.zip
Simplify EXPLAIN code for Memoize
This removes a needless special case for Memoize's FORMAT TEXT EXPLAIN output. ExplainPropertyText() outputs the same thing in text mode as the special-case code was doing, so removing the special-case code results in the same EXPLAIN output, just with less code. It seems like a good idea to fix this to help prevent future changes in this area from copying the same pattern. Author: Ilia Evdokimov <ilya.evdokimov@tantorlabs.com> Reported-by: David Rowley <dgrowleyml@gmail.com> Discussion: https://postgr.es/m/88a71bcd-0b5c-4d0b-8107-757e96f402d5@tantorlabs.com
Diffstat (limited to 'src/backend/commands/explain.c')
-rw-r--r--src/backend/commands/explain.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/backend/commands/explain.c b/src/backend/commands/explain.c
index 33a16d2d8e2..391b34a2af2 100644
--- a/src/backend/commands/explain.c
+++ b/src/backend/commands/explain.c
@@ -3625,18 +3625,8 @@ show_memoize_info(MemoizeState *mstate, List *ancestors, ExplainState *es)
separator = ", ";
}
- if (es->format != EXPLAIN_FORMAT_TEXT)
- {
- ExplainPropertyText("Cache Key", keystr.data, es);
- ExplainPropertyText("Cache Mode", mstate->binary_mode ? "binary" : "logical", es);
- }
- else
- {
- ExplainIndentText(es);
- appendStringInfo(es->str, "Cache Key: %s\n", keystr.data);
- ExplainIndentText(es);
- appendStringInfo(es->str, "Cache Mode: %s\n", mstate->binary_mode ? "binary" : "logical");
- }
+ ExplainPropertyText("Cache Key", keystr.data, es);
+ ExplainPropertyText("Cache Mode", mstate->binary_mode ? "binary" : "logical", es);
pfree(keystr.data);