|
34 | 34 | #include"utils/pg_locale.h"
|
35 | 35 | #include"utils/sortsupport.h"
|
36 | 36 |
|
37 |
| -#ifdefDEBUG_ABBREV_KEYS |
38 |
| -#defineDEBUG_elog_outputDEBUG1 |
39 |
| -#endif |
40 | 37 |
|
41 | 38 | /* GUC variable */
|
42 | 39 | intbytea_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 |
| -#ifdefDEBUG_ABBREV_KEYS |
| 2149 | +#ifdefTRACE_SORT |
| 2150 | +if (trace_sort) |
2153 | 2151 | {
|
2154 | 2152 | doublenorm_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 |
| -#ifdefDEBUG_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 | +#ifdefTRACE_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;
|
|