postgres.git / summary / log / commit / refs

commit    617636328f5285fa2e0b7e42f4ae3cb0d82f8b5e
Author:   Michael Paquier <michael@paquier.xyz>
Date:     Sat Aug 22 07:23:16 2026 +0000

    Retire execdebug.h and its debugging facility
    
    execdebug.h includes "pretty old and crufty" code used to print
    debugging information in the executor.  As reported recently, this code
    has not compiled in the last 10 years or so, and there are better
    alternatives available, such as elog().
    
    There is no indication that this facility is still being used, so remove
    it along with its associated debugging macros:
    EXEC_NESTLOOPDEBUG
    EXEC_SORTDEBUG
    EXEC_MERGEJOINDEBUG
    
    Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
    Reviewed-by: Tatsuya Kawata <kawatatatsuya0913@gmail.com>
    Discussion: https://postgr.es/m/aoFfAvp6xdk7Cdi6@paquier.xyz


src/backend/executor/nodeIncrementalSort.c | 41 +-------- src/backend/executor/nodeMergejoin.c | 121 +-------------------------- src/backend/executor/nodeNestloop.c | 38 +-------- src/backend/executor/nodeSort.c | 27 +----- src/backend/jit/llvm/llvmjit_expr.c | 1 - src/include/executor/execdebug.h | 130 ----------------------------- 6 files changed, 4 insertions(+), 354 deletions(-) diff --git a/src/backend/executor/nodeIncrementalSort.c b/src/backend/executor/nodeIncrementalSort.c index f2e92d7cf0b..613d7d1c349 100644 --- a/src/backend/executor/nodeIncrementalSort.c +++ b/src/backend/executor/nodeIncrementalSort.c @@ -78,7 +78,7 @@ #include "postgres.h" -#include "executor/execdebug.h" +#include "executor/executor.h" #include "executor/nodeIncrementalSort.h" #include "miscadmin.h" #include "utils/lsyscache.h" @@ -328,8 +328,6 @@ switchToPresortedPrefixMode(PlanState *pstate) */ if (node->bounded) { - SO1_printf("Setting bound on presorted prefix tuplesort to: " INT64_FORMAT "\n", - node->bound - node->bound_Done); tuplesort_set_bound(node->prefixsort_state, node->bound - node->bound_Done); } @@ -397,9 +395,7 @@ switchToPresortedPrefixMode(PlanState *pstate) * remaining in the large single prefix key group we think we've * encountered. */ - SO1_printf("Moving " INT64_FORMAT " tuples to presorted prefix tuplesort\n", nTuples); node->n_fullsort_remaining -= nTuples; - SO1_printf("Setting n_fullsort_remaining to " INT64_FORMAT "\n", node->n_fullsort_remaining); if (node->n_fullsort_remaining == 0) { @@ -412,7 +408,6 @@ switchToPresortedPrefixMode(PlanState *pstate) * execution node to load into the presorted prefix tuplesort. */ ExecCopySlot(node->group_pivot, node->transfer_tuple); - SO_printf("Setting execution_status to INCSORT_LOADPREFIXSORT (switchToPresortedPrefixMode)\n"); node->execution_status = INCSORT_LOADPREFIXSORT; /* @@ -430,7 +425,6 @@ switchToPresortedPrefixMode(PlanState *pstate) * out all of those tuples, and then come back around to find another * batch. */ - SO1_printf("Sorting presorted prefix tuplesort with " INT64_FORMAT " tuples\n", nTuples); tuplesort_performsort(node->prefixsort_state); INSTRUMENT_SORT_GROUP(node, prefixsort); @@ -443,12 +437,9 @@ switchToPresortedPrefixMode(PlanState *pstate) * - n), so store the current number of processed tuples for use * in configuring sorting bound. */ - SO2_printf("Changing bound_Done from " INT64_FORMAT " to " INT64_FORMAT "\n", - Min(node->bound, node->bound_Done + nTuples), node->bound_Done); node->bound_Done = Min(node->bound, node->bound_Done + nTuples); } - SO_printf("Setting execution_status to INCSORT_READPREFIXSORT (switchToPresortedPrefixMode)\n"); node->execution_status = INCSORT_READPREFIXSORT; } } @@ -555,8 +546,6 @@ ExecIncrementalSort(PlanState *pstate) * need to re-execute the prefix mode transition function to pull * out the next prefix key group. */ - SO1_printf("Re-calling switchToPresortedPrefixMode() because n_fullsort_remaining is > 0 (" INT64_FORMAT ")\n", - node->n_fullsort_remaining); switchToPresortedPrefixMode(pstate); } else @@ -567,7 +556,6 @@ ExecIncrementalSort(PlanState *pstate) * it's time to start the process all over again by building a new * group in the full sort state. */ - SO_printf("Setting execution_status to INCSORT_LOADFULLSORT (n_fullsort_remaining > 0)\n"); node->execution_status = INCSORT_LOADFULLSORT; } } @@ -690,12 +678,10 @@ ExecIncrementalSort(PlanState *pstate) */ node->outerNodeDone = true; - SO1_printf("Sorting fullsort with " INT64_FORMAT " tuples\n", nTuples); tuplesort_performsort(fullsort_state); INSTRUMENT_SORT_GROUP(node, fullsort); - SO_printf("Setting execution_status to INCSORT_READFULLSORT (final tuple)\n"); node->execution_status = INCSORT_READFULLSORT; break; } @@ -759,9 +745,6 @@ ExecIncrementalSort(PlanState *pstate) * current number of processed tuples for later use * configuring the sort state's bound. */ - SO2_printf("Changing bound_Done from " INT64_FORMAT " to " INT64_FORMAT "\n", - node->bound_Done, - Min(node->bound, node->bound_Done + nTuples)); node->bound_Done = Min(node->bound, node->bound_Done + nTuples); } @@ -770,13 +753,10 @@ ExecIncrementalSort(PlanState *pstate) * sort and transition modes to reading out the sorted * tuples. */ - SO1_printf("Sorting fullsort tuplesort with " INT64_FORMAT " tuples\n", - nTuples); tuplesort_performsort(fullsort_state); INSTRUMENT_SORT_GROUP(node, fullsort); - SO_printf("Setting execution_status to INCSORT_READFULLSORT (found end of group)\n"); node->execution_status = INCSORT_READFULLSORT; break; } @@ -811,7 +791,6 @@ ExecIncrementalSort(PlanState *pstate) * on FIFO retrieval semantics when transferring them to the * presorted prefix tuplesort. */ - SO1_printf("Sorting fullsort tuplesort with " INT64_FORMAT " tuples\n", nTuples); tuplesort_performsort(fullsort_state); INSTRUMENT_SORT_GROUP(node, fullsort); @@ -830,14 +809,9 @@ ExecIncrementalSort(PlanState *pstate) { int64 currentBound = node->bound - node->bound_Done; - SO2_printf("Read " INT64_FORMAT " tuples, but setting to " INT64_FORMAT " because we used bounded sort\n", - nTuples, Min(currentBound, nTuples)); nTuples = Min(currentBound, nTuples); } - SO1_printf("Setting n_fullsort_remaining to " INT64_FORMAT " and calling switchToPresortedPrefixMode()\n", - nTuples); - /* * We might have multiple prefix key groups in the full sort * state, so the mode transition function needs to know that @@ -925,12 +899,10 @@ ExecIncrementalSort(PlanState *pstate) * Perform the sort and begin returning the tuples to the parent plan * node. */ - SO1_printf("Sorting presorted prefix tuplesort with " INT64_FORMAT " tuples\n", nTuples); tuplesort_performsort(node->prefixsort_state); INSTRUMENT_SORT_GROUP(node, prefixsort); - SO_printf("Setting execution_status to INCSORT_READPREFIXSORT (found end of group)\n"); node->execution_status = INCSORT_READPREFIXSORT; if (node->bounded) @@ -941,9 +913,6 @@ ExecIncrementalSort(PlanState *pstate) * - n), so store the current number of processed tuples for use * in configuring sorting bound. */ - SO2_printf("Changing bound_Done from " INT64_FORMAT " to " INT64_FORMAT "\n", - node->bound_Done, - Min(node->bound, node->bound_Done + nTuples)); node->bound_Done = Min(node->bound, node->bound_Done + nTuples); } } @@ -975,8 +944,6 @@ ExecInitIncrementalSort(IncrementalSort *node, EState *estate, int eflags) { IncrementalSortState *incrsortstate; - SO_printf("ExecInitIncrementalSort: initializing sort node\n"); - /* * Incremental sort can't be used with EXEC_FLAG_BACKWARD or * EXEC_FLAG_MARK, because the current sort state contains only one sort @@ -1062,8 +1029,6 @@ ExecInitIncrementalSort(IncrementalSort *node, EState *estate, int eflags) MakeSingleTupleTableSlot(ExecGetResultType(outerPlanState(incrsortstate)), &TTSOpsMinimalTuple); - SO_printf("ExecInitIncrementalSort: sort node initialized\n"); - return incrsortstate; } @@ -1074,8 +1039,6 @@ ExecInitIncrementalSort(IncrementalSort *node, EState *estate, int eflags) void ExecEndIncrementalSort(IncrementalSortState *node) { - SO_printf("ExecEndIncrementalSort: shutting down sort node\n"); - ExecDropSingleTupleTableSlot(node->group_pivot); ExecDropSingleTupleTableSlot(node->transfer_tuple); @@ -1097,8 +1060,6 @@ ExecEndIncrementalSort(IncrementalSortState *node) * Shut down the subplan. */ ExecEndNode(outerPlanState(node)); - - SO_printf("ExecEndIncrementalSort: sort node shutdown\n"); } void diff --git a/src/backend/executor/nodeMergejoin.c b/src/backend/executor/nodeMergejoin.c index 4d7e5729ca4..9e14ac78613 100644 --- a/src/backend/executor/nodeMergejoin.c +++ b/src/backend/executor/nodeMergejoin.c @@ -93,7 +93,7 @@ #include "postgres.h" #include "access/nbtree.h" -#include "executor/execdebug.h" +#include "executor/executor.h" #include "executor/instrument.h" #include "executor/nodeMergejoin.h" #include "miscadmin.h" @@ -462,8 +462,6 @@ MJFillOuter(MergeJoinState *node) * qualification succeeded. now form the desired projection tuple and * return the slot containing it. */ - MJ_printf("ExecMergeJoin: returning outer fill tuple\n"); - return ExecProject(node->js.ps.ps_ProjInfo); } else @@ -493,8 +491,6 @@ MJFillInner(MergeJoinState *node) * qualification succeeded. now form the desired projection tuple and * return the slot containing it. */ - MJ_printf("ExecMergeJoin: returning inner fill tuple\n"); - return ExecProject(node->js.ps.ps_ProjInfo); } else @@ -530,64 +526,6 @@ check_constant_qual(List *qual, bool *is_const_false) } -/* ---------------------------------------------------------------- - * ExecMergeTupleDump - * - * This function is called through the MJ_dump() macro - * when EXEC_MERGEJOINDEBUG is defined - * ---------------------------------------------------------------- - */ -#ifdef EXEC_MERGEJOINDEBUG - -static void -ExecMergeTupleDumpOuter(MergeJoinState *mergestate) -{ - TupleTableSlot *outerSlot = mergestate->mj_OuterTupleSlot; - - printf("==== outer tuple ====\n"); - if (TupIsNull(outerSlot)) - printf("(nil)\n"); - else - MJ_debugtup(outerSlot); -} - -static void -ExecMergeTupleDumpInner(MergeJoinState *mergestate) -{ - TupleTableSlot *innerSlot = mergestate->mj_InnerTupleSlot; - - printf("==== inner tuple ====\n"); - if (TupIsNull(innerSlot)) - printf("(nil)\n"); - else - MJ_debugtup(innerSlot); -} - -static void -ExecMergeTupleDumpMarked(MergeJoinState *mergestate) -{ - TupleTableSlot *markedSlot = mergestate->mj_MarkedTupleSlot; - - printf("==== marked tuple ====\n"); - if (TupIsNull(markedSlot)) - printf("(nil)\n"); - else - MJ_debugtup(markedSlot); -} - -static void -ExecMergeTupleDump(MergeJoinState *mergestate) -{ - printf("******** ExecMergeTupleDump ********\n"); - - ExecMergeTupleDumpOuter(mergestate); - ExecMergeTupleDumpInner(mergestate); - ExecMergeTupleDumpMarked(mergestate); - - printf("********\n"); -} -#endif - /* ---------------------------------------------------------------- * ExecMergeJoin * ---------------------------------------------------------------- @@ -632,8 +570,6 @@ ExecMergeJoin(PlanState *pstate) */ for (;;) { - MJ_dump(node); - /* * get the current state of the join and do things accordingly. */ @@ -647,8 +583,6 @@ ExecMergeJoin(PlanState *pstate) * to INITIALIZE_INNER state for the inner subplan. */ case EXEC_MJ_INITIALIZE_OUTER: - MJ_printf("ExecMergeJoin: EXEC_MJ_INITIALIZE_OUTER\n"); - outerTupleSlot = ExecProcNode(outerPlan); node->mj_OuterTupleSlot = outerTupleSlot; @@ -677,7 +611,6 @@ ExecMergeJoin(PlanState *pstate) break; case MJEVAL_ENDOFJOIN: /* No more outer tuples */ - MJ_printf("ExecMergeJoin: nothing in outer subplan\n"); if (doFillInner) { /* @@ -695,8 +628,6 @@ ExecMergeJoin(PlanState *pstate) break; case EXEC_MJ_INITIALIZE_INNER: - MJ_printf("ExecMergeJoin: EXEC_MJ_INITIALIZE_INNER\n"); - innerTupleSlot = ExecProcNode(innerPlan); node->mj_InnerTupleSlot = innerTupleSlot; @@ -732,7 +663,6 @@ ExecMergeJoin(PlanState *pstate) break; case MJEVAL_ENDOFJOIN: /* No more inner tuples */ - MJ_printf("ExecMergeJoin: nothing in inner subplan\n"); if (doFillOuter) { /* @@ -757,7 +687,6 @@ ExecMergeJoin(PlanState *pstate) * the next inner tuple (EXEC_MJ_NEXTINNER). */ case EXEC_MJ_JOINTUPLES: - MJ_printf("ExecMergeJoin: EXEC_MJ_JOINTUPLES\n"); /* * Set the next state machine state. The right things will @@ -787,7 +716,6 @@ ExecMergeJoin(PlanState *pstate) qualResult = (joinqual == NULL || ExecQual(joinqual, econtext)); - MJ_DEBUG_QUAL(joinqual, qualResult); if (qualResult) { @@ -820,7 +748,6 @@ ExecMergeJoin(PlanState *pstate) qualResult = (otherqual == NULL || ExecQual(otherqual, econtext)); - MJ_DEBUG_QUAL(otherqual, qualResult); if (qualResult) { @@ -828,8 +755,6 @@ ExecMergeJoin(PlanState *pstate) * qualification succeeded. now form the desired * projection tuple and return the slot containing it. */ - MJ_printf("ExecMergeJoin: returning tuple\n"); - return ExecProject(node->js.ps.ps_ProjInfo); } else @@ -848,8 +773,6 @@ ExecMergeJoin(PlanState *pstate) * outer-join fill tuple for this inner tuple. */ case EXEC_MJ_NEXTINNER: - MJ_printf("ExecMergeJoin: EXEC_MJ_NEXTINNER\n"); - if (doFillInner && !node->mj_MatchedInner) { /* @@ -875,7 +798,6 @@ ExecMergeJoin(PlanState *pstate) */ innerTupleSlot = ExecProcNode(innerPlan); node->mj_InnerTupleSlot = innerTupleSlot; - MJ_DEBUG_PROC_NODE(innerTupleSlot); node->mj_MatchedInner = false; /* Compute join values and check for unmatchability */ @@ -894,7 +816,6 @@ ExecMergeJoin(PlanState *pstate) * tuple. */ compareResult = MJCompare(node); - MJ_DEBUG_COMPARE(compareResult); if (compareResult == 0) node->mj_JoinState = EXEC_MJ_JOINTUPLES; @@ -949,8 +870,6 @@ ExecMergeJoin(PlanState *pstate) *------------------------------------------------ */ case EXEC_MJ_NEXTOUTER: - MJ_printf("ExecMergeJoin: EXEC_MJ_NEXTOUTER\n"); - if (doFillOuter && !node->mj_MatchedOuter) { /* @@ -971,7 +890,6 @@ ExecMergeJoin(PlanState *pstate) */ outerTupleSlot = ExecProcNode(outerPlan); node->mj_OuterTupleSlot = outerTupleSlot; - MJ_DEBUG_PROC_NODE(outerTupleSlot); node->mj_MatchedOuter = false; /* Compute join values and check for unmatchability */ @@ -987,7 +905,6 @@ ExecMergeJoin(PlanState *pstate) break; case MJEVAL_ENDOFJOIN: /* No more outer tuples */ - MJ_printf("ExecMergeJoin: end of outer subplan\n"); innerTupleSlot = node->mj_InnerTupleSlot; if (doFillInner && !TupIsNull(innerTupleSlot)) { @@ -1039,7 +956,6 @@ ExecMergeJoin(PlanState *pstate) *--------------------------------------------------------- */ case EXEC_MJ_TESTOUTER: - MJ_printf("ExecMergeJoin: EXEC_MJ_TESTOUTER\n"); /* * Here we must compare the outer tuple with the marked inner @@ -1050,7 +966,6 @@ ExecMergeJoin(PlanState *pstate) (void) MJEvalInnerValues(node, innerTupleSlot); compareResult = MJCompare(node); - MJ_DEBUG_COMPARE(compareResult); if (compareResult == 0) { @@ -1177,7 +1092,6 @@ ExecMergeJoin(PlanState *pstate) *---------------------------------------------------------- */ case EXEC_MJ_SKIP_TEST: - MJ_printf("ExecMergeJoin: EXEC_MJ_SKIP_TEST\n"); /* * before we advance, make sure the current tuples do not @@ -1185,7 +1099,6 @@ ExecMergeJoin(PlanState *pstate) * marked tuple position and go join them. */ compareResult = MJCompare(node); - MJ_DEBUG_COMPARE(compareResult); if (compareResult == 0) { @@ -1211,8 +1124,6 @@ ExecMergeJoin(PlanState *pstate) * outer-join fill tuple for this outer tuple. */ case EXEC_MJ_SKIPOUTER_ADVANCE: - MJ_printf("ExecMergeJoin: EXEC_MJ_SKIPOUTER_ADVANCE\n"); - if (doFillOuter && !node->mj_MatchedOuter) { /* @@ -1233,7 +1144,6 @@ ExecMergeJoin(PlanState *pstate) */ outerTupleSlot = ExecProcNode(outerPlan); node->mj_OuterTupleSlot = outerTupleSlot; - MJ_DEBUG_PROC_NODE(outerTupleSlot); node->mj_MatchedOuter = false; /* Compute join values and check for unmatchability */ @@ -1249,7 +1159,6 @@ ExecMergeJoin(PlanState *pstate) break; case MJEVAL_ENDOFJOIN: /* No more outer tuples */ - MJ_printf("ExecMergeJoin: end of outer subplan\n"); innerTupleSlot = node->mj_InnerTupleSlot; if (doFillInner && !TupIsNull(innerTupleSlot)) { @@ -1273,8 +1182,6 @@ ExecMergeJoin(PlanState *pstate) * outer-join fill tuple for this inner tuple. */ case EXEC_MJ_SKIPINNER_ADVANCE: - MJ_printf("ExecMergeJoin: EXEC_MJ_SKIPINNER_ADVANCE\n"); - if (doFillInner && !node->mj_MatchedInner) { /* @@ -1299,7 +1206,6 @@ ExecMergeJoin(PlanState *pstate) */ innerTupleSlot = ExecProcNode(innerPlan); node->mj_InnerTupleSlot = innerTupleSlot; - MJ_DEBUG_PROC_NODE(innerTupleSlot); node->mj_MatchedInner = false; /* Compute join values and check for unmatchability */ @@ -1319,7 +1225,6 @@ ExecMergeJoin(PlanState *pstate) break; case MJEVAL_ENDOFJOIN: /* No more inner tuples */ - MJ_printf("ExecMergeJoin: end of inner subplan\n"); outerTupleSlot = node->mj_OuterTupleSlot; if (doFillOuter && !TupIsNull(outerTupleSlot)) { @@ -1341,8 +1246,6 @@ ExecMergeJoin(PlanState *pstate) * null-fill any remaining unmatched inner tuples. */ case EXEC_MJ_ENDOUTER: - MJ_printf("ExecMergeJoin: EXEC_MJ_ENDOUTER\n"); - Assert(doFillInner); if (!node->mj_MatchedInner) @@ -1369,14 +1272,10 @@ ExecMergeJoin(PlanState *pstate) */ innerTupleSlot = ExecProcNode(innerPlan); node->mj_InnerTupleSlot = innerTupleSlot; - MJ_DEBUG_PROC_NODE(innerTupleSlot); node->mj_MatchedInner = false; if (TupIsNull(innerTupleSlot)) - { - MJ_printf("ExecMergeJoin: end of inner subplan\n"); return NULL; - } /* Else remain in ENDOUTER state and process next tuple. */ break; @@ -1387,8 +1286,6 @@ ExecMergeJoin(PlanState *pstate) * any remaining unmatched outer tuples. */ case EXEC_MJ_ENDINNER: - MJ_printf("ExecMergeJoin: EXEC_MJ_ENDINNER\n"); - Assert(doFillOuter); if (!node->mj_MatchedOuter) @@ -1411,14 +1308,10 @@ ExecMergeJoin(PlanState *pstate) */ outerTupleSlot = ExecProcNode(outerPlan); node->mj_OuterTupleSlot = outerTupleSlot; - MJ_DEBUG_PROC_NODE(outerTupleSlot); node->mj_MatchedOuter = false; if (TupIsNull(outerTupleSlot)) - { - MJ_printf("ExecMergeJoin: end of outer subplan\n"); return NULL; - } /* Else remain in ENDINNER state and process next tuple. */ break; @@ -1448,9 +1341,6 @@ ExecInitMergeJoin(MergeJoin *node, EState *estate, int eflags) /* check for unsupported flags */ Assert(!(eflags & (EXEC_FLAG_BACKWARD | EXEC_FLAG_MARK))); - MJ1_printf("ExecInitMergeJoin: %s\n", - "initializing node"); - /* * create state structure */ @@ -1621,9 +1511,6 @@ ExecInitMergeJoin(MergeJoin *node, EState *estate, int eflags) /* * initialization successful */ - MJ1_printf("ExecInitMergeJoin: %s\n", - "node initialized"); - return mergestate; } @@ -1637,17 +1524,11 @@ ExecInitMergeJoin(MergeJoin *node, EState *estate, int eflags) void ExecEndMergeJoin(MergeJoinState *node) { - MJ1_printf("ExecEndMergeJoin: %s\n", - "ending node processing"); - /* * shut down the subplans */ ExecEndNode(innerPlanState(node)); ExecEndNode(outerPlanState(node)); - - MJ1_printf("ExecEndMergeJoin: %s\n", - "node processing ended"); } void diff --git a/src/backend/executor/nodeNestloop.c b/src/backend/executor/nodeNestloop.c index 809311ab513..da48c9b204b 100644 --- a/src/backend/executor/nodeNestloop.c +++ b/src/backend/executor/nodeNestloop.c @@ -21,7 +21,7 @@ #include "postgres.h" -#include "executor/execdebug.h" +#include "executor/executor.h" #include "executor/instrument.h" #include "executor/nodeNestloop.h" #include "miscadmin.h" @@ -76,8 +76,6 @@ ExecNestLoop(PlanState *pstate) /* * get information from the node */ - ENL1_printf("getting info from node"); - nl = (NestLoop *) node->js.ps.plan; joinqual = node->js.joinqual; otherqual = node->js.ps.qual; @@ -95,8 +93,6 @@ ExecNestLoop(PlanState *pstate) * Ok, everything is setup for the join so now loop until we return a * qualifying join tuple. */ - ENL1_printf("entering main loop"); - for (;;) { /* @@ -105,19 +101,14 @@ ExecNestLoop(PlanState *pstate) */ if (node->nl_NeedNewOuter) { - ENL1_printf("getting new outer tuple"); outerTupleSlot = ExecProcNode(outerPlan); /* * if there are no more outer tuples, then the join is complete.. */ if (TupIsNull(outerTupleSlot)) - { - ENL1_printf("no outer tuple, ending join"); return NULL; - } - ENL1_printf("saving new outer tuple information"); econtext->ecxt_outertuple = outerTupleSlot; node->nl_NeedNewOuter = false; node->nl_MatchedOuter = false; @@ -148,22 +139,17 @@ ExecNestLoop(PlanState *pstate) /* * now rescan the inner plan */ - ENL1_printf("rescanning inner plan"); ExecReScan(innerPlan); } /* * we have an outerTuple, try to get the next inner tuple. */ - ENL1_printf("getting new inner tuple"); - innerTupleSlot = ExecProcNode(innerPlan); econtext->ecxt_innertuple = innerTupleSlot; if (TupIsNull(innerTupleSlot)) { - ENL1_printf("no inner tuple, need new outer tuple"); - node->nl_NeedNewOuter = true; if (!node->nl_MatchedOuter && @@ -178,8 +164,6 @@ ExecNestLoop(PlanState *pstate) */ econtext->ecxt_innertuple = node->nl_NullInnerTupleSlot; - ENL1_printf("testing qualification for outer-join tuple"); - if (otherqual == NULL || ExecQual(otherqual, econtext)) { /* @@ -187,8 +171,6 @@ ExecNestLoop(PlanState *pstate) * the slot containing the result tuple using * ExecProject(). */ - ENL1_printf("qualification succeeded, projecting tuple"); - return ExecProject(node->js.ps.ps_ProjInfo); } else @@ -209,8 +191,6 @@ ExecNestLoop(PlanState *pstate) * Only the joinquals determine MatchedOuter status, but all quals * must pass to actually return the tuple. */ - ENL1_printf("testing qualification"); - if (ExecQual(joinqual, econtext)) { node->nl_MatchedOuter = true; @@ -236,8 +216,6 @@ ExecNestLoop(PlanState *pstate) * qualification was satisfied so we project and return the * slot containing the result tuple using ExecProject(). */ - ENL1_printf("qualification succeeded, projecting tuple"); - return ExecProject(node->js.ps.ps_ProjInfo); } else @@ -250,8 +228,6 @@ ExecNestLoop(PlanState *pstate) * Tuple fails qual, so free per-tuple memory and try again. */ ResetExprContext(econtext); - - ENL1_printf("qualification failed, looping"); } } @@ -267,9 +243,6 @@ ExecInitNestLoop(NestLoop *node, EState *estate, int eflags) /* check for unsupported flags */ Assert(!(eflags & (EXEC_FLAG_BACKWARD | EXEC_FLAG_MARK))); - NL1_printf("ExecInitNestLoop: %s\n", - "initializing node"); - /* * create state structure */ @@ -346,9 +319,6 @@ ExecInitNestLoop(NestLoop *node, EState *estate, int eflags) nlstate->nl_NeedNewOuter = true; nlstate->nl_MatchedOuter = false; - NL1_printf("ExecInitNestLoop: %s\n", - "node initialized"); - return nlstate; } @@ -361,17 +331,11 @@ ExecInitNestLoop(NestLoop *node, EState *estate, int eflags) void ExecEndNestLoop(NestLoopState *node) { - NL1_printf("ExecEndNestLoop: %s\n", - "ending node processing"); - /* * close down subplans */ ExecEndNode(outerPlanState(node)); ExecEndNode(innerPlanState(node)); - - NL1_printf("ExecEndNestLoop: %s\n", - "node processing ended"); } /* ---------------------------------------------------------------- diff --git a/src/backend/executor/nodeSort.c b/src/backend/executor/nodeSort.c index e02313f7813..2398bdabf0d 100644 --- a/src/backend/executor/nodeSort.c +++ b/src/backend/executor/nodeSort.c @@ -16,7 +16,7 @@ #include "postgres.h" #include "access/parallel.h" -#include "executor/execdebug.h" +#include "executor/executor.h" #include "executor/nodeSort.h" #include "miscadmin.h" #include "utils/tuplesort.h" @@ -60,9 +60,6 @@ ExecSort(PlanState *pstate) /* * get state info from node */ - SO1_printf("ExecSort: %s\n", - "entering routine"); - estate = node->ss.ps.state; dir = estate->es_direction; tuplesortstate = (Tuplesortstate *) node->tuplesortstate; @@ -79,9 +76,6 @@ ExecSort(PlanState *pstate) TupleDesc tupDesc; int tuplesortopts = TUPLESORT_NONE; - SO1_printf("ExecSort: %s\n", - "sorting subplan"); - /* * Want to scan subplan in the forward direction while creating the * sorted data. @@ -91,9 +85,6 @@ ExecSort(PlanState *pstate) /* * Initialize tuplesort module. */ - SO1_printf("ExecSort: %s\n", - "calling tuplesort_begin"); - outerNode = outerPlanState(node); tupDesc = ExecGetResultType(outerNode); @@ -179,12 +170,8 @@ ExecSort(PlanState *pstate) si = &node->shared_info->sinstrument[ParallelWorkerNumber]; tuplesort_get_stats(tuplesortstate, si); } - SO1_printf("ExecSort: %s\n", "sorting done"); } - SO1_printf("ExecSort: %s\n", - "retrieving tuple from tuplesort"); - slot = node->ss.ps.ps_ResultTupleSlot; /* @@ -223,9 +210,6 @@ ExecInitSort(Sort *node, EState *estate, int eflags) SortState *sortstate; TupleDesc outerTupDesc; - SO1_printf("ExecInitSort: %s\n", - "initializing sort node"); - /* * create state structure */ @@ -287,9 +271,6 @@ ExecInitSort(Sort *node, EState *estate, int eflags) else sortstate->datumSort = false; - SO1_printf("ExecInitSort: %s\n", - "sort node initialized"); - return sortstate; } @@ -300,9 +281,6 @@ ExecInitSort(Sort *node, EState *estate, int eflags) void ExecEndSort(SortState *node) { - SO1_printf("ExecEndSort: %s\n", - "shutting down sort node"); - /* * Release tuplesort resources */ @@ -314,9 +292,6 @@ ExecEndSort(SortState *node) * shut down the subplan */ ExecEndNode(outerPlanState(node)); - - SO1_printf("ExecEndSort: %s\n", - "sort node shutdown"); } /* ---------------------------------------------------------------- diff --git a/src/backend/jit/llvm/llvmjit_expr.c b/src/backend/jit/llvm/llvmjit_expr.c index 09a52a18921..fc80d3e55fe 100644 --- a/src/backend/jit/llvm/llvmjit_expr.c +++ b/src/backend/jit/llvm/llvmjit_expr.c @@ -23,7 +23,6 @@ #include "catalog/objectaccess.h" #include "catalog/pg_type.h" #include "executor/execExpr.h" -#include "executor/execdebug.h" #include "executor/nodeAgg.h" #include "executor/nodeSubplan.h" #include "funcapi.h" diff --git a/src/include/executor/execdebug.h b/src/include/executor/execdebug.h deleted file mode 100644 index 3e110551914..00000000000 --- a/src/include/executor/execdebug.h +++ /dev/null @@ -1,130 +0,0 @@ -/*------------------------------------------------------------------------- - * - * execdebug.h - * #defines governing debugging behaviour in the executor - * - * XXX this is all pretty old and crufty. Newer code tends to use elog() - * for debug printouts, because that's more flexible than printf(). - * - * - * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group - * Portions Copyright (c) 1994, Regents of the University of California - * - * src/include/executor/execdebug.h - * - *------------------------------------------------------------------------- - */ -#ifndef EXECDEBUG_H -#define EXECDEBUG_H - -#include "executor/executor.h" -#include "nodes/print.h" - -/* ---------------------------------------------------------------- - * debugging defines. - * - * If you want certain debugging behaviour, then #define - * the variable to 1. No need to explicitly #undef by default, - * since we can use -D compiler options to enable features. - * - thomas 1999-02-20 - * ---------------------------------------------------------------- - */ - -/* ---------------- - * EXEC_NESTLOOPDEBUG is a flag which turns on debugging of the - * nest loop node by NL_printf() and ENL_printf() in nodeNestloop.c - * ---------------- - */ -/* #define EXEC_NESTLOOPDEBUG */ - -/* ---------------- - * EXEC_SORTDEBUG is a flag which turns on debugging of - * the ExecSort() stuff by SO_printf() in nodeSort.c - * ---------------- - */ -/* #define EXEC_SORTDEBUG */ - -/* ---------------- - * EXEC_MERGEJOINDEBUG is a flag which turns on debugging of - * the ExecMergeJoin() stuff by MJ_printf() in nodeMergejoin.c - * ---------------- - */ -/* #define EXEC_MERGEJOINDEBUG */ - -/* ---------------------------------------------------------------- - * #defines controlled by above definitions - * - * Note: most of these are "incomplete" because I didn't - * need the ones not defined. More should be added - * only as necessary -cim 10/26/89 - * ---------------------------------------------------------------- - */ -#define T_OR_F(b) ((b) ? "true" : "false") -#define NULL_OR_TUPLE(slot) (TupIsNull(slot) ? "null" : "a tuple") - -/* ---------------- - * nest loop debugging defines - * ---------------- - */ -#ifdef EXEC_NESTLOOPDEBUG -#define NL_nodeDisplay(l) nodeDisplay(l) -#define NL_printf(s) printf(s) -#define NL1_printf(s, a) printf(s, a) -#define ENL1_printf(message) printf("ExecNestLoop: %s\n", message) -#else -#define NL_nodeDisplay(l) -#define NL_printf(s) -#define NL1_printf(s, a) -#define ENL1_printf(message) -#endif /* EXEC_NESTLOOPDEBUG */ - -/* ---------------- - * sort node debugging defines - * ---------------- - */ -#ifdef EXEC_SORTDEBUG -#define SO_nodeDisplay(l) nodeDisplay(l) -#define SO_printf(s) printf(s) -#define SO1_printf(s, p) printf(s, p) -#define SO2_printf(s, p1, p2) printf(s, p1, p2) -#else -#define SO_nodeDisplay(l) -#define SO_printf(s) -#define SO1_printf(s, p) -#define SO2_printf(s, p1, p2) -#endif /* EXEC_SORTDEBUG */ - -/* ---------------- - * merge join debugging defines - * ---------------- - */ -#ifdef EXEC_MERGEJOINDEBUG - -#define MJ_nodeDisplay(l) nodeDisplay(l) -#define MJ_printf(s) printf(s) -#define MJ1_printf(s, p) printf(s, p) -#define MJ2_printf(s, p1, p2) printf(s, p1, p2) -#define MJ_debugtup(slot) debugtup(slot, NULL) -#define MJ_dump(state) ExecMergeTupleDump(state) -#define MJ_DEBUG_COMPARE(res) \ - MJ1_printf(" MJCompare() returns %d\n", (res)) -#define MJ_DEBUG_QUAL(clause, res) \ - MJ2_printf(" ExecQual(%s, econtext) returns %s\n", \ - CppAsString(clause), T_OR_F(res)) -#define MJ_DEBUG_PROC_NODE(slot) \ - MJ2_printf(" %s = ExecProcNode(...) returns %s\n", \ - CppAsString(slot), NULL_OR_TUPLE(slot)) -#else - -#define MJ_nodeDisplay(l) -#define MJ_printf(s) -#define MJ1_printf(s, p) -#define MJ2_printf(s, p1, p2) -#define MJ_debugtup(slot) -#define MJ_dump(state) -#define MJ_DEBUG_COMPARE(res) -#define MJ_DEBUG_QUAL(clause, res) -#define MJ_DEBUG_PROC_NODE(slot) -#endif /* EXEC_MERGEJOINDEBUG */ - -#endif /* EXECDEBUG_H */