diff --git a/src/backend/commands/explain.c b/src/backend/commands/explain.c index cb968ec23d4..394d60a6096 100644 --- a/src/backend/commands/explain.c +++ b/src/backend/commands/explain.c @@ -2083,9 +2083,7 @@ ExplainNode(PlanState *planstate, List *ancestors, } if (ResManagerPrintOperatorMemoryLimits()) - { - ExplainPropertyInteger("operatorMem", "kB", PlanStateOperatorMemKB(planstate), es); - } + appendStringInfo(es->str, " (operatorMem: "UINT64_FORMAT"kB)", PlanStateOperatorMemKB(planstate)); /* * 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 ead97ec3f51..fb7920297bc 100644 --- a/src/test/regress/expected/workfile/hashjoin_spill.out +++ b/src/test/regress/expected/workfile/hashjoin_spill.out @@ -39,6 +39,22 @@ 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 08e30501ef2..2f7a48203a2 100644 --- a/src/test/regress/sql/workfile/hashjoin_spill.sql +++ b/src/test/regress/sql/workfile/hashjoin_spill.sql @@ -42,6 +42,7 @@ 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;