2424#include "utils/guc.h"
2525#include "utils/logtape.h"
2626#include "utils/pg_rusage.h"
27- #include "utils/probes.h"
2827
2928#include "rum.h" /* RumItem */
3029
4039#define LogicalTapeRewindForWrite (x , y ) LogicalTapeRewind((x), (y), true)
4140#endif
4241
43- #if PG_VERSION_NUM >= 110000
44- #define RUM_SORT_START (INT1 , INT2 , INT3 , INT4 , INT5 ) \
45- TRACE_POSTGRESQL_SORT_START(INT1, INT2, INT3, INT4, INT5, false)
46- #else
47- #define RUM_SORT_START (INT1 , INT2 , INT3 , INT4 , INT5 ) \
48- TRACE_POSTGRESQL_SORT_START(INT1, INT2, INT3, INT4, INT5)
49- #endif
50-
5142#if PG_VERSION_NUM >= 110000
5243#define LogicalTapeSetCreate (X ) LogicalTapeSetCreate(X, NULL, NULL, 1)
5344#define LogicalTapeFreeze (X , Y ) LogicalTapeFreeze(X, Y, NULL)
@@ -57,6 +48,11 @@ TRACE_POSTGRESQL_SORT_START(INT1, INT2, INT3, INT4, INT5)
5748 * Below are copied definitions from src/backend/utils/sort/tuplesort.c.
5849 */
5950
51+ /* GUC variables */
52+ #ifdef TRACE_SORT
53+ bool trace_sort = false;
54+ #endif
55+
6056typedef struct
6157{
6258 void * tuple ; /* the tuple proper */
@@ -740,12 +736,6 @@ rum_tuplesort_begin_rum(int workMem, int nKeys, bool randomAccess,
740736
741737 state -> nKeys = nKeys ;
742738
743- RUM_SORT_START (INDEX_SORT ,
744- false, /* no unique check */
745- state -> nKeys ,
746- workMem ,
747- randomAccess );
748-
749739 state -> comparetup = comparetup_rum ;
750740 state -> copytup = copytup_rum ;
751741 state -> writetup = writetup_rum ;
@@ -773,12 +763,6 @@ rum_tuplesort_begin_rumitem(int workMem, FmgrInfo *cmp)
773763 "begin rumitem sort: workMem = %d" , workMem );
774764#endif
775765
776- RUM_SORT_START (INDEX_SORT ,
777- false, /* no unique check */
778- 2 ,
779- workMem ,
780- false);
781-
782766 state -> cmp = cmp ;
783767 state -> comparetup = comparetup_rumitem ;
784768 state -> copytup = copytup_rumitem ;
@@ -836,15 +820,6 @@ rum_tuplesort_end(RumTuplesortstate *state)
836820 elog (LOG , "internal sort ended, %ld KB used: %s" ,
837821 spaceUsed , pg_rusage_show (& state -> ru_start ));
838822 }
839-
840- TRACE_POSTGRESQL_SORT_DONE (state -> tapeset != NULL , spaceUsed );
841- #else
842-
843- /*
844- * If you disabled TRACE_SORT, you can still probe sort__done, but you
845- * ain't getting space-used stats.
846- */
847- TRACE_POSTGRESQL_SORT_DONE (state -> tapeset != NULL , 0L );
848823#endif
849824
850825 /* Free any execution state created for CLUSTER case */
0 commit comments