From 8cd7c5eebfbb5b930fe4798e9ef7f547ccd28a0a Mon Sep 17 00:00:00 2001 From: Zhang Mingli Date: Tue, 7 Nov 2023 09:36:14 +0800 Subject: [PATCH] Revert "Fix explain bad indent when showing operatorMem. (#288)" This reverts commit 5a33f731cde9fc360447aef250dc2b567caaf783. --- src/backend/commands/explain.c | 4 +++- .../regress/expected/workfile/hashjoin_spill.out | 16 ---------------- src/test/regress/sql/workfile/hashjoin_spill.sql | 1 - 3 files changed, 3 insertions(+), 18 deletions(-) diff --git a/src/backend/commands/explain.c b/src/backend/commands/explain.c index d44a70b04e9..14f1bf596bc 100644 --- a/src/backend/commands/explain.c +++ b/src/backend/commands/explain.c @@ -2083,7 +2083,9 @@ ExplainNode(PlanState *planstate, List *ancestors, } if (ResManagerPrintOperatorMemoryLimits()) - appendStringInfo(es->str, " (operatorMem: "UINT64_FORMAT"kB)", PlanStateOperatorMemKB(planstate)); + { + ExplainPropertyInteger("operatorMem", "kB", PlanStateOperatorMemKB(planstate), es); + } /* * We have to forcibly clean up the instrumentation state because we * haven't done ExecutorEnd yet. This is pretty grotty ... diff --git a/src/test/regress/expected/workfile/hashjoin_spill.out b/src/test/regress/expected/workfile/hashjoin_spill.out index fb7920297bc..ead97ec3f51 100644 --- a/src/test/regress/expected/workfile/hashjoin_spill.out +++ b/src/test/regress/expected/workfile/hashjoin_spill.out @@ -39,22 +39,6 @@ insert into test_hj_spill SELECT i,i,i%1000,i,i,i,i,i from (select count(*) as nsegments from gp_segment_configuration where role='p' and content >= 0) foo) bar; SET statement_mem=1024; set gp_resqueue_print_operator_memory_limits=on; -explain(costs off) select count(i3), avg(i3::numeric) from (SELECT t1.* FROM test_hj_spill AS t1 RIGHT JOIN test_hj_spill AS t2 ON t1.i1=t2.i2) foo; - QUERY PLAN ----------------------------------------------------------------------------------------------- - Finalize Aggregate (operatorMem: 100kB) - -> Gather Motion 3:1 (slice1; segments: 3) (operatorMem: 100kB) - -> Partial Aggregate (operatorMem: 100kB) - -> Hash Left Join (operatorMem: 100kB) - Hash Cond: (t2.i2 = t1.i1) - -> Redistribute Motion 3:3 (slice2; segments: 3) (operatorMem: 100kB) - Hash Key: t2.i2 - -> Seq Scan on test_hj_spill t2 (operatorMem: 100kB) - -> Hash (operatorMem: 624kB) - -> Seq Scan on test_hj_spill t1 (operatorMem: 100kB) - Optimizer: Postgres query optimizer -(11 rows) - set gp_workfile_compression = on; select count(i3), avg(i3::numeric) from (SELECT t1.* FROM test_hj_spill AS t1 RIGHT JOIN test_hj_spill AS t2 ON t1.i1=t2.i2) foo; count | avg diff --git a/src/test/regress/sql/workfile/hashjoin_spill.sql b/src/test/regress/sql/workfile/hashjoin_spill.sql index 2f7a48203a2..08e30501ef2 100644 --- a/src/test/regress/sql/workfile/hashjoin_spill.sql +++ b/src/test/regress/sql/workfile/hashjoin_spill.sql @@ -42,7 +42,6 @@ insert into test_hj_spill SELECT i,i,i%1000,i,i,i,i,i from (select count(*) as nsegments from gp_segment_configuration where role='p' and content >= 0) foo) bar; SET statement_mem=1024; set gp_resqueue_print_operator_memory_limits=on; -explain(costs off) select count(i3), avg(i3::numeric) from (SELECT t1.* FROM test_hj_spill AS t1 RIGHT JOIN test_hj_spill AS t2 ON t1.i1=t2.i2) foo; set gp_workfile_compression = on; select count(i3), avg(i3::numeric) from (SELECT t1.* FROM test_hj_spill AS t1 RIGHT JOIN test_hj_spill AS t2 ON t1.i1=t2.i2) foo;