Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitaea652a

Browse files
committed
Make trace_sort control abbreviation debug output for the text opclass.
This is consistent with what the new numeric suppor for abbreviated keysnow does, and seems much more convenient than having a separate compilerdefine to control this debug output.Peter Geoghegan
1 parentb216ad7 commitaea652a

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

‎src/backend/utils/adt/varlena.c

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@
3434
#include"utils/pg_locale.h"
3535
#include"utils/sortsupport.h"
3636

37-
#ifdefDEBUG_ABBREV_KEYS
38-
#defineDEBUG_elog_outputDEBUG1
39-
#endif
4037

4138
/* GUC variable */
4239
intbytea_output=BYTEA_OUTPUT_HEX;
@@ -2149,11 +2146,13 @@ bttext_abbrev_abort(int memtupcount, SortSupport ssup)
21492146
* time there are differences within full key strings not captured in
21502147
* abbreviations.
21512148
*/
2152-
#ifdefDEBUG_ABBREV_KEYS
2149+
#ifdefTRACE_SORT
2150+
if (trace_sort)
21532151
{
21542152
doublenorm_abbrev_card=abbrev_distinct / (double)memtupcount;
21552153

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)",
21572156
memtupcount,abbrev_distinct,key_distinct,norm_abbrev_card,
21582157
tss->prop_card);
21592158
}
@@ -2219,11 +2218,11 @@ bttext_abbrev_abort(int memtupcount, SortSupport ssup)
22192218
* of moderately high to high abbreviated cardinality. There is little to
22202219
* lose but much to gain, which our strategy reflects.
22212220
*/
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);
22272226
#endif
22282227

22292228
return true;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp