aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Geoghegan <pg@bowt.ie>2018-11-01 09:18:55 -0700
committerPeter Geoghegan <pg@bowt.ie>2018-11-01 09:18:55 -0700
commit886319d71bd5c0ba18c9b46a1e3765d88f5ed0e7 (patch)
tree6f464463a42828ee4853f050f5a26605139e9a1f /src
parentc33a01c7979dc267c81ece612af783ecacf22bc0 (diff)
downloadpostgresql-886319d71bd5c0ba18c9b46a1e3765d88f5ed0e7.tar.gz
postgresql-886319d71bd5c0ba18c9b46a1e3765d88f5ed0e7.zip
Adjust trace_sort log messages.
The project message style guide dictates: "When citing the name of an object, state what kind of object it is". The parallel CREATE INDEX patch added a worker number to most of the trace_sort messages within tuplesort.c without specifying the object type. Bring these messages into compliance with the style guide. We're still treating a leader or serial Tuplesortstate as having worker number -1. trace_sort is a developer option, and these two cases are highly comparable, so this seems appropriate. Per complaint from Tom Lane. Discussion: https://postgr.es/m/8330.1540831863@sss.pgh.pa.us Backpatch: 11-, where parallel CREATE INDEX was introduced.
Diffstat (limited to 'src')
-rw-r--r--src/backend/utils/sort/tuplesort.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/backend/utils/sort/tuplesort.c b/src/backend/utils/sort/tuplesort.c
index 9fb33b9035e..549baf4b4f6 100644
--- a/src/backend/utils/sort/tuplesort.c
+++ b/src/backend/utils/sort/tuplesort.c
@@ -1259,11 +1259,11 @@ tuplesort_end(Tuplesortstate *state)
if (trace_sort)
{
if (state->tapeset)
- elog(LOG, "%s of %d ended, %ld disk blocks used: %s",
+ elog(LOG, "%s of worker %d ended, %ld disk blocks used: %s",
SERIAL(state) ? "external sort" : "parallel external sort",
state->worker, spaceUsed, pg_rusage_show(&state->ru_start));
else
- elog(LOG, "%s of %d ended, %ld KB used: %s",
+ elog(LOG, "%s of worker %d ended, %ld KB used: %s",
SERIAL(state) ? "internal sort" : "unperformed parallel sort",
state->worker, spaceUsed, pg_rusage_show(&state->ru_start));
}
@@ -1793,7 +1793,7 @@ tuplesort_performsort(Tuplesortstate *state)
#ifdef TRACE_SORT
if (trace_sort)
- elog(LOG, "performsort of %d starting: %s",
+ elog(LOG, "performsort of worker %d starting: %s",
state->worker, pg_rusage_show(&state->ru_start));
#endif
@@ -1878,11 +1878,11 @@ tuplesort_performsort(Tuplesortstate *state)
if (trace_sort)
{
if (state->status == TSS_FINALMERGE)
- elog(LOG, "performsort of %d done (except %d-way final merge): %s",
+ elog(LOG, "performsort of worker %d done (except %d-way final merge): %s",
state->worker, state->activeTapes,
pg_rusage_show(&state->ru_start));
else
- elog(LOG, "performsort of %d done: %s",
+ elog(LOG, "performsort of worker %d done: %s",
state->worker, pg_rusage_show(&state->ru_start));
}
#endif
@@ -2410,7 +2410,7 @@ inittapes(Tuplesortstate *state, bool mergeruns)
#ifdef TRACE_SORT
if (trace_sort)
- elog(LOG, "%d switching to external sort with %d tapes: %s",
+ elog(LOG, "worker %d switching to external sort with %d tapes: %s",
state->worker, maxTapes, pg_rusage_show(&state->ru_start));
#endif
@@ -2660,7 +2660,7 @@ mergeruns(Tuplesortstate *state)
*/
#ifdef TRACE_SORT
if (trace_sort)
- elog(LOG, "%d using " INT64_FORMAT " KB of memory for read buffers among %d input tapes",
+ elog(LOG, "worker %d using " INT64_FORMAT " KB of memory for read buffers among %d input tapes",
state->worker, state->availMem / 1024, numInputTapes);
#endif
@@ -2836,7 +2836,7 @@ mergeonerun(Tuplesortstate *state)
#ifdef TRACE_SORT
if (trace_sort)
- elog(LOG, "%d finished %d-way merge step: %s", state->worker,
+ elog(LOG, "worker %d finished %d-way merge step: %s", state->worker,
state->activeTapes, pg_rusage_show(&state->ru_start));
#endif
}
@@ -2971,7 +2971,7 @@ dumptuples(Tuplesortstate *state, bool alltuples)
#ifdef TRACE_SORT
if (trace_sort)
- elog(LOG, "%d starting quicksort of run %d: %s",
+ elog(LOG, "worker %d starting quicksort of run %d: %s",
state->worker, state->currentRun,
pg_rusage_show(&state->ru_start));
#endif
@@ -2984,7 +2984,7 @@ dumptuples(Tuplesortstate *state, bool alltuples)
#ifdef TRACE_SORT
if (trace_sort)
- elog(LOG, "%d finished quicksort of run %d: %s",
+ elog(LOG, "worker %d finished quicksort of run %d: %s",
state->worker, state->currentRun,
pg_rusage_show(&state->ru_start));
#endif
@@ -3012,7 +3012,7 @@ dumptuples(Tuplesortstate *state, bool alltuples)
#ifdef TRACE_SORT
if (trace_sort)
- elog(LOG, "%d finished writing run %d to tape %d: %s",
+ elog(LOG, "worker %d finished writing run %d to tape %d: %s",
state->worker, state->currentRun, state->destTape,
pg_rusage_show(&state->ru_start));
#endif