Adjust EXPLAIN output for parallel Result Cache plans

Enterprise / PostgreSQL - David Rowley [] - 30 April 2021 02:46 UTC

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.

3c80e96dff Adjust EXPLAIN output for parallel Result Cache plans
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(-)


  • Share