pgsql: Adjust EXPLAIN output for parallel Result Cache plans - Mailing list pgsql-committers

From David Rowley
Subject pgsql: Adjust EXPLAIN output for parallel Result Cache plans
Date
Msg-id E1lcJBI-0002Uy-5B@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Adjust EXPLAIN output for parallel Result Cache plans

Here we adjust the EXPLAIN ANALYZE output for Result Cache so that we
don't show any Result Cache stats for parallel workers who don't
contribute anything to Result Cache plan nodes.

I originally had ideas that workers who don't help could still have their
Result Cache stats displayed.  The idea with that was so that I could
write some parallel Result Cache regression tests that show the EXPLAIN
ANALYZE output.  However, I realized a little too late that such tests
would just not be possible to have run in a stable way on the buildfarm.

With that knowledge, before 9eacee2e6 went in, I had removed all of the
tests that were showing the EXPLAIN ANALYZE output of a parallel Result
Cache plan, however, I forgot to put back the code that adjusts the
EXPLAIN output to hide the Result Cache stats for parallel workers who
were not fast enough to help out before query execution was over. All
other nodes behave this way and so should Result Cache.

Additionally, with this change, it now seems safe enough to remove the SET
force_parallel_mode = off that I had added to the regression tests.

Also, perform some cleanup in the partition_prune tests. I had adjusted
the explain_parallel_append() function to sanitize the Result Cache
EXPLAIN ANALYZE output.  However, since I didn't actually include any
parallel Result Cache tests that show their EXPLAIN ANALYZE output, that
code does nothing and can be removed.

In passing, move the setting of memPeakKb into the scope where it's used.

Reported-by: Amit Khandekar
Author: David Rowley, Amit Khandekar
Discussion: https://postgr.es/m/CAJ3gD9d8SkfY95GpM1zmsOtX2-Ogx5q-WLsf8f0ykEb0hCRK3w@mail.gmail.com

Branch
------
master

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

Modified Files
--------------
src/backend/commands/explain.c                | 25 ++++++++++++++++---------
src/test/regress/expected/partition_prune.out |  3 ---
src/test/regress/expected/resultcache.out     |  4 ----
src/test/regress/sql/partition_prune.sql      |  3 ---
src/test/regress/sql/resultcache.sql          |  5 +----
5 files changed, 17 insertions(+), 23 deletions(-)


pgsql-committers by date:

Previous
From: Amit Kapila
Date:
Subject: pgsql: Another try to fix the test case added by commit f5fc2f5b23.
Next
From: Amit Kapila
Date:
Subject: pgsql: Fix the bugs in selecting the transaction for streaming.