Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit c8e2d42

Browse files
committed
Remove TRACE_SORT macro
The TRACE_SORT macro guarded the availability of the trace_sort GUC setting. But it has been enabled by default ever since it was introduced in PostgreSQL 8.1, and there have been no reports that someone wanted to disable it. So just remove the macro to simplify things. (For the avoidance of doubt: The trace_sort GUC is still there. This only removes the rarely-used macro guarding it.) Reviewed-by: Heikki Linnakangas <hlinnaka@iki.fi> Discussion: https://www.postgresql.org/message-id/flat/be5f7162-7c1d-44e3-9a78-74dcaa6529f2%40eisentraut.org
1 parent bf3401f commit c8e2d42

File tree

11 files changed

+0
-95
lines changed

11 files changed

+0
-95
lines changed

doc/src/sgml/config.sgml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11711,9 +11711,6 @@ dynamic_library_path = 'C:\tools\postgresql;H:\my_project\lib;$libdir'
1171111711
<listitem>
1171211712
<para>
1171311713
If on, emit information about resource usage during sort operations.
11714-
This parameter is only available if the <symbol>TRACE_SORT</symbol> macro
11715-
was defined when <productname>PostgreSQL</productname> was compiled.
11716-
(However, <symbol>TRACE_SORT</symbol> is currently defined by default.)
1171711714
</para>
1171811715
</listitem>
1171911716
</varlistentry>

src/backend/utils/adt/mac.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -430,13 +430,11 @@ macaddr_abbrev_abort(int memtupcount, SortSupport ssup)
430430
*/
431431
if (abbr_card > 100000.0)
432432
{
433-
#ifdef TRACE_SORT
434433
if (trace_sort)
435434
elog(LOG,
436435
"macaddr_abbrev: estimation ends at cardinality %f"
437436
" after " INT64_FORMAT " values (%d rows)",
438437
abbr_card, uss->input_count, memtupcount);
439-
#endif
440438
uss->estimating = false;
441439
return false;
442440
}
@@ -449,23 +447,19 @@ macaddr_abbrev_abort(int memtupcount, SortSupport ssup)
449447
*/
450448
if (abbr_card < uss->input_count / 2000.0 + 0.5)
451449
{
452-
#ifdef TRACE_SORT
453450
if (trace_sort)
454451
elog(LOG,
455452
"macaddr_abbrev: aborting abbreviation at cardinality %f"
456453
" below threshold %f after " INT64_FORMAT " values (%d rows)",
457454
abbr_card, uss->input_count / 2000.0 + 0.5, uss->input_count,
458455
memtupcount);
459-
#endif
460456
return true;
461457
}
462458

463-
#ifdef TRACE_SORT
464459
if (trace_sort)
465460
elog(LOG,
466461
"macaddr_abbrev: cardinality %f after " INT64_FORMAT
467462
" values (%d rows)", abbr_card, uss->input_count, memtupcount);
468-
#endif
469463

470464
return false;
471465
}

src/backend/utils/adt/network.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -503,13 +503,11 @@ network_abbrev_abort(int memtupcount, SortSupport ssup)
503503
*/
504504
if (abbr_card > 100000.0)
505505
{
506-
#ifdef TRACE_SORT
507506
if (trace_sort)
508507
elog(LOG,
509508
"network_abbrev: estimation ends at cardinality %f"
510509
" after " INT64_FORMAT " values (%d rows)",
511510
abbr_card, uss->input_count, memtupcount);
512-
#endif
513511
uss->estimating = false;
514512
return false;
515513
}
@@ -522,23 +520,19 @@ network_abbrev_abort(int memtupcount, SortSupport ssup)
522520
*/
523521
if (abbr_card < uss->input_count / 2000.0 + 0.5)
524522
{
525-
#ifdef TRACE_SORT
526523
if (trace_sort)
527524
elog(LOG,
528525
"network_abbrev: aborting abbreviation at cardinality %f"
529526
" below threshold %f after " INT64_FORMAT " values (%d rows)",
530527
abbr_card, uss->input_count / 2000.0 + 0.5, uss->input_count,
531528
memtupcount);
532-
#endif
533529
return true;
534530
}
535531

536-
#ifdef TRACE_SORT
537532
if (trace_sort)
538533
elog(LOG,
539534
"network_abbrev: cardinality %f after " INT64_FORMAT
540535
" values (%d rows)", abbr_card, uss->input_count, memtupcount);
541-
#endif
542536

543537
return false;
544538
}

src/backend/utils/adt/numeric.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2127,13 +2127,11 @@ numeric_abbrev_abort(int memtupcount, SortSupport ssup)
21272127
*/
21282128
if (abbr_card > 100000.0)
21292129
{
2130-
#ifdef TRACE_SORT
21312130
if (trace_sort)
21322131
elog(LOG,
21332132
"numeric_abbrev: estimation ends at cardinality %f"
21342133
" after " INT64_FORMAT " values (%d rows)",
21352134
abbr_card, nss->input_count, memtupcount);
2136-
#endif
21372135
nss->estimating = false;
21382136
return false;
21392137
}
@@ -2149,24 +2147,20 @@ numeric_abbrev_abort(int memtupcount, SortSupport ssup)
21492147
*/
21502148
if (abbr_card < nss->input_count / 10000.0 + 0.5)
21512149
{
2152-
#ifdef TRACE_SORT
21532150
if (trace_sort)
21542151
elog(LOG,
21552152
"numeric_abbrev: aborting abbreviation at cardinality %f"
21562153
" below threshold %f after " INT64_FORMAT " values (%d rows)",
21572154
abbr_card, nss->input_count / 10000.0 + 0.5,
21582155
nss->input_count, memtupcount);
2159-
#endif
21602156
return true;
21612157
}
21622158

2163-
#ifdef TRACE_SORT
21642159
if (trace_sort)
21652160
elog(LOG,
21662161
"numeric_abbrev: cardinality %f"
21672162
" after " INT64_FORMAT " values (%d rows)",
21682163
abbr_card, nss->input_count, memtupcount);
2169-
#endif
21702164

21712165
return false;
21722166
}

src/backend/utils/adt/uuid.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -307,13 +307,11 @@ uuid_abbrev_abort(int memtupcount, SortSupport ssup)
307307
*/
308308
if (abbr_card > 100000.0)
309309
{
310-
#ifdef TRACE_SORT
311310
if (trace_sort)
312311
elog(LOG,
313312
"uuid_abbrev: estimation ends at cardinality %f"
314313
" after " INT64_FORMAT " values (%d rows)",
315314
abbr_card, uss->input_count, memtupcount);
316-
#endif
317315
uss->estimating = false;
318316
return false;
319317
}
@@ -326,23 +324,19 @@ uuid_abbrev_abort(int memtupcount, SortSupport ssup)
326324
*/
327325
if (abbr_card < uss->input_count / 2000.0 + 0.5)
328326
{
329-
#ifdef TRACE_SORT
330327
if (trace_sort)
331328
elog(LOG,
332329
"uuid_abbrev: aborting abbreviation at cardinality %f"
333330
" below threshold %f after " INT64_FORMAT " values (%d rows)",
334331
abbr_card, uss->input_count / 2000.0 + 0.5, uss->input_count,
335332
memtupcount);
336-
#endif
337333
return true;
338334
}
339335

340-
#ifdef TRACE_SORT
341336
if (trace_sort)
342337
elog(LOG,
343338
"uuid_abbrev: cardinality %f after " INT64_FORMAT
344339
" values (%d rows)", abbr_card, uss->input_count, memtupcount);
345-
#endif
346340

347341
return false;
348342
}

src/backend/utils/adt/varlena.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2455,7 +2455,6 @@ varstr_abbrev_abort(int memtupcount, SortSupport ssup)
24552455
* time there are differences within full key strings not captured in
24562456
* abbreviations.
24572457
*/
2458-
#ifdef TRACE_SORT
24592458
if (trace_sort)
24602459
{
24612460
double norm_abbrev_card = abbrev_distinct / (double) memtupcount;
@@ -2465,7 +2464,6 @@ varstr_abbrev_abort(int memtupcount, SortSupport ssup)
24652464
memtupcount, abbrev_distinct, key_distinct, norm_abbrev_card,
24662465
sss->prop_card);
24672466
}
2468-
#endif
24692467

24702468
/*
24712469
* If the number of distinct abbreviated keys approximately matches the
@@ -2527,12 +2525,10 @@ varstr_abbrev_abort(int memtupcount, SortSupport ssup)
25272525
* of moderately high to high abbreviated cardinality. There is little to
25282526
* lose but much to gain, which our strategy reflects.
25292527
*/
2530-
#ifdef TRACE_SORT
25312528
if (trace_sort)
25322529
elog(LOG, "varstr_abbrev: aborted abbreviation at %d "
25332530
"(abbrev_distinct: %f, key_distinct: %f, prop_card: %f)",
25342531
memtupcount, abbrev_distinct, key_distinct, sss->prop_card);
2535-
#endif
25362532

25372533
return true;
25382534
}

src/backend/utils/misc/guc_tables.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1698,7 +1698,6 @@ struct config_bool ConfigureNamesBool[] =
16981698
NULL, NULL, NULL
16991699
},
17001700

1701-
#ifdef TRACE_SORT
17021701
{
17031702
{"trace_sort", PGC_USERSET, DEVELOPER_OPTIONS,
17041703
gettext_noop("Emit information about resource usage in sorting."),
@@ -1709,7 +1708,6 @@ struct config_bool ConfigureNamesBool[] =
17091708
false,
17101709
NULL, NULL, NULL
17111710
},
1712-
#endif
17131711

17141712
#ifdef TRACE_SYNCSCAN
17151713
/* this is undocumented because not exposed in a standard build */

0 commit comments

Comments
 (0)