diff options
author | Tomas Vondra <tomas.vondra@postgresql.org> | 2020-04-06 23:19:13 +0200 |
---|---|---|
committer | Tomas Vondra <tomas.vondra@postgresql.org> | 2020-04-06 23:19:13 +0200 |
commit | 7d6d82a52493ad47c57662d0ac6758da551e87a5 (patch) | |
tree | 04ff24fc3a1c82b6ee0c25a24c882d65f789d670 | |
parent | d2d8a229bc58a2014dce1c7a4fcdb6c5ab9fb8da (diff) | |
download | postgresql-7d6d82a52493ad47c57662d0ac6758da551e87a5.tar.gz postgresql-7d6d82a52493ad47c57662d0ac6758da551e87a5.zip |
Fix show_incremental_sort_info with force_parallel_mode
When executed with force_parallel_mode=regress, the function was exiting
too early and thus failed to print the worker stats. Fixed by making it
more like show_sort_info.
Discussion: https://postgr.es/m/CAPpHfds1waRZ=NOmueYq0sx1ZSCnt+5QJvizT8ndT2=etZEeAQ@mail.gmail.com
-rw-r--r-- | src/backend/commands/explain.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/backend/commands/explain.c b/src/backend/commands/explain.c index 62c86ecdc59..c31f3e0987f 100644 --- a/src/backend/commands/explain.c +++ b/src/backend/commands/explain.c @@ -2880,19 +2880,22 @@ show_incremental_sort_info(IncrementalSortState *incrsortstate, fullsortGroupInfo = &incrsortstate->incsort_info.fullsortGroupInfo; - if (!(es->analyze && fullsortGroupInfo->groupCount > 0)) + if (!es->analyze) return; - show_incremental_sort_group_info(fullsortGroupInfo, "Full-sort", true, es); - prefixsortGroupInfo = &incrsortstate->incsort_info.prefixsortGroupInfo; - if (prefixsortGroupInfo->groupCount > 0) + if (fullsortGroupInfo->groupCount > 0) { + show_incremental_sort_group_info(fullsortGroupInfo, "Full-sort", true, es); + prefixsortGroupInfo = &incrsortstate->incsort_info.prefixsortGroupInfo; + if (prefixsortGroupInfo->groupCount > 0) + { + if (es->format == EXPLAIN_FORMAT_TEXT) + appendStringInfo(es->str, " "); + show_incremental_sort_group_info(prefixsortGroupInfo, "Presorted", false, es); + } if (es->format == EXPLAIN_FORMAT_TEXT) - appendStringInfo(es->str, " "); - show_incremental_sort_group_info(prefixsortGroupInfo, "Presorted", false, es); + appendStringInfo(es->str, "\n"); } - if (es->format == EXPLAIN_FORMAT_TEXT) - appendStringInfo(es->str, "\n"); if (incrsortstate->shared_info != NULL) { |