|
34 | 34 | #include "utils/pg_locale.h" |
35 | 35 | #include "utils/sortsupport.h" |
36 | 36 |
|
37 | | -#ifdef DEBUG_ABBREV_KEYS |
38 | | -#define DEBUG_elog_output DEBUG1 |
39 | | -#endif |
40 | 37 |
|
41 | 38 | /* GUC variable */ |
42 | 39 | int bytea_output = BYTEA_OUTPUT_HEX; |
@@ -2149,11 +2146,13 @@ bttext_abbrev_abort(int memtupcount, SortSupport ssup) |
2149 | 2146 | * time there are differences within full key strings not captured in |
2150 | 2147 | * abbreviations. |
2151 | 2148 | */ |
2152 | | -#ifdef DEBUG_ABBREV_KEYS |
| 2149 | +#ifdef TRACE_SORT |
| 2150 | + if (trace_sort) |
2153 | 2151 | { |
2154 | 2152 | double norm_abbrev_card = abbrev_distinct / (double) memtupcount; |
2155 | 2153 |
|
2156 | | - elog(DEBUG_elog_output, "abbrev_distinct after %d: %f (key_distinct: %f, norm_abbrev_card: %f, prop_card: %f)", |
| 2154 | + elog(LOG, "bttext_abbrev: abbrev_distinct after %d: %f " |
| 2155 | + "(key_distinct: %f, norm_abbrev_card: %f, prop_card: %f)", |
2157 | 2156 | memtupcount, abbrev_distinct, key_distinct, norm_abbrev_card, |
2158 | 2157 | tss->prop_card); |
2159 | 2158 | } |
@@ -2219,11 +2218,11 @@ bttext_abbrev_abort(int memtupcount, SortSupport ssup) |
2219 | 2218 | * of moderately high to high abbreviated cardinality. There is little to |
2220 | 2219 | * lose but much to gain, which our strategy reflects. |
2221 | 2220 | */ |
2222 | | -#ifdef DEBUG_ABBREV_KEYS |
2223 | | - elog(DEBUG_elog_output, "would have aborted abbreviation due to worst-case at %d. abbrev_distinct: %f, key_distinct: %f, prop_card: %f", |
2224 | | - memtupcount, abbrev_distinct, key_distinct, tss->prop_card); |
2225 | | - /* Actually abort only when debugging is disabled */ |
2226 | | - return false; |
| 2221 | +#ifdef TRACE_SORT |
| 2222 | + if (trace_sort) |
| 2223 | + elog(LOG, "bttext_abbrev: aborted abbreviation at %d " |
| 2224 | + "(abbrev_distinct: %f, key_distinct: %f, prop_card: %f)", |
| 2225 | + memtupcount, abbrev_distinct, key_distinct, tss->prop_card); |
2227 | 2226 | #endif |
2228 | 2227 |
|
2229 | 2228 | return true; |
|
0 commit comments