1996-07-09 08:22:35 +02:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
*
|
1999-02-14 00:22:53 +01:00
|
|
|
* execdebug.h
|
1997-09-07 07:04:48 +02:00
|
|
|
* #defines governing debugging behaviour in the executor
|
1996-07-09 08:22:35 +02:00
|
|
|
*
|
|
|
|
*
|
2001-01-24 20:43:33 +01:00
|
|
|
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
|
2000-01-26 06:58:53 +01:00
|
|
|
* Portions Copyright (c) 1994, Regents of the University of California
|
1996-07-09 08:22:35 +02:00
|
|
|
*
|
2001-10-28 07:26:15 +01:00
|
|
|
* $Id: execdebug.h,v 1.18 2001/10/28 06:26:06 momjian Exp $
|
1996-07-09 08:22:35 +02:00
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
#ifndef EXECDEBUG_H
|
|
|
|
#define EXECDEBUG_H
|
|
|
|
|
2000-06-15 02:52:26 +02:00
|
|
|
#include "executor/executor.h"
|
1999-07-16 01:04:24 +02:00
|
|
|
#include "nodes/print.h"
|
1999-07-15 17:21:54 +02:00
|
|
|
|
1996-07-09 08:22:35 +02:00
|
|
|
/* ----------------------------------------------------------------
|
1997-09-07 07:04:48 +02:00
|
|
|
* debugging defines.
|
1996-07-09 08:22:35 +02:00
|
|
|
*
|
1997-09-07 07:04:48 +02:00
|
|
|
* If you want certain debugging behaviour, then #define
|
1999-02-23 08:39:40 +01:00
|
|
|
* 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
|
1996-07-09 08:22:35 +02:00
|
|
|
* ----------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* ----------------
|
1997-09-07 07:04:48 +02:00
|
|
|
* EXEC_TUPLECOUNT is a #define which causes the
|
|
|
|
* executor keep track of tuple counts. This might be
|
|
|
|
* causing some problems with the decstation stuff so
|
|
|
|
* you might want to undefine this if you are doing work
|
|
|
|
* on the decs - cim 10/20/89
|
1996-07-09 08:22:35 +02:00
|
|
|
* ----------------
|
|
|
|
#undef EXEC_TUPLECOUNT
|
1999-02-23 08:39:40 +01:00
|
|
|
*/
|
1996-07-09 08:22:35 +02:00
|
|
|
|
|
|
|
/* ----------------
|
1997-09-07 07:04:48 +02:00
|
|
|
* EXEC_CONTEXTDEBUG turns on the printing of debugging information
|
|
|
|
* by CXT_printf() calls regarding which memory context is the
|
|
|
|
* CurrentMemoryContext for palloc() calls.
|
1996-07-09 08:22:35 +02:00
|
|
|
* ----------------
|
|
|
|
#undef EXEC_CONTEXTDEBUG
|
1999-02-23 08:39:40 +01:00
|
|
|
*/
|
1996-07-09 08:22:35 +02:00
|
|
|
|
|
|
|
/* ----------------
|
1997-09-07 07:04:48 +02:00
|
|
|
* EXEC_UTILSDEBUG is a flag which turns on debugging of the
|
|
|
|
* executor utilities by EU_printf() in eutils.c
|
1996-07-09 08:22:35 +02:00
|
|
|
* ----------------
|
|
|
|
#undef EXEC_UTILSDEBUG
|
1999-02-23 08:39:40 +01:00
|
|
|
*/
|
1996-07-09 08:22:35 +02:00
|
|
|
|
|
|
|
/* ----------------
|
1997-09-07 07:04:48 +02:00
|
|
|
* EXEC_NESTLOOPDEBUG is a flag which turns on debugging of the
|
|
|
|
* nest loop node by NL_printf() and ENL_printf() in nestloop.c
|
1996-07-09 08:22:35 +02:00
|
|
|
* ----------------
|
|
|
|
#undef EXEC_NESTLOOPDEBUG
|
1999-02-23 08:39:40 +01:00
|
|
|
*/
|
1996-07-09 08:22:35 +02:00
|
|
|
|
|
|
|
/* ----------------
|
1997-09-07 07:04:48 +02:00
|
|
|
* EXEC_PROCDEBUG is a flag which turns on debugging of
|
|
|
|
* ExecProcNode() by PN_printf() in procnode.c
|
1996-07-09 08:22:35 +02:00
|
|
|
* ----------------
|
|
|
|
#undef EXEC_PROCDEBUG
|
1999-02-23 08:39:40 +01:00
|
|
|
*/
|
1996-07-09 08:22:35 +02:00
|
|
|
|
|
|
|
/* ----------------
|
1997-09-07 07:04:48 +02:00
|
|
|
* EXEC_EVALDEBUG is a flag which turns on debugging of
|
|
|
|
* ExecEval and ExecTargetList() stuff by EV_printf() in qual.c
|
1996-07-09 08:22:35 +02:00
|
|
|
* ----------------
|
|
|
|
#undef EXEC_EVALDEBUG
|
1999-02-23 08:39:40 +01:00
|
|
|
*/
|
1996-07-09 08:22:35 +02:00
|
|
|
|
|
|
|
/* ----------------
|
1997-09-07 07:04:48 +02:00
|
|
|
* EXEC_SCANDEBUG is a flag which turns on debugging of
|
|
|
|
* the ExecSeqScan() stuff by S_printf() in seqscan.c
|
1996-07-09 08:22:35 +02:00
|
|
|
* ----------------
|
|
|
|
#undef EXEC_SCANDEBUG
|
1999-02-23 08:39:40 +01:00
|
|
|
*/
|
1996-07-09 08:22:35 +02:00
|
|
|
|
|
|
|
/* ----------------
|
1997-09-07 07:04:48 +02:00
|
|
|
* EXEC_SORTDEBUG is a flag which turns on debugging of
|
|
|
|
* the ExecSort() stuff by SO_printf() in sort.c
|
1996-07-09 08:22:35 +02:00
|
|
|
* ----------------
|
|
|
|
#undef EXEC_SORTDEBUG
|
1999-02-23 08:39:40 +01:00
|
|
|
*/
|
1996-07-09 08:22:35 +02:00
|
|
|
|
|
|
|
/* ----------------
|
1997-09-07 07:04:48 +02:00
|
|
|
* EXEC_MERGEJOINDEBUG is a flag which turns on debugging of
|
|
|
|
* the ExecMergeJoin() stuff by MJ_printf() in mergejoin.c
|
1996-07-09 08:22:35 +02:00
|
|
|
* ----------------
|
|
|
|
#undef EXEC_MERGEJOINDEBUG
|
1999-02-23 08:39:40 +01:00
|
|
|
*/
|
1996-07-09 08:22:35 +02:00
|
|
|
|
|
|
|
/* ----------------------------------------------------------------
|
1997-09-07 07:04:48 +02:00
|
|
|
* #defines controlled by above definitions
|
1996-07-09 08:22:35 +02:00
|
|
|
*
|
1997-09-07 07:04:48 +02:00
|
|
|
* 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
|
1996-07-09 08:22:35 +02:00
|
|
|
* ----------------------------------------------------------------
|
|
|
|
*/
|
2000-09-12 23:07:18 +02:00
|
|
|
#define T_OR_F(b) ((b) ? "true" : "false")
|
1997-09-07 07:04:48 +02:00
|
|
|
#define NULL_OR_TUPLE(slot) (TupIsNull(slot) ? "null" : "a tuple")
|
1996-07-09 08:22:35 +02:00
|
|
|
|
|
|
|
|
|
|
|
/* ----------------
|
1997-09-07 07:04:48 +02:00
|
|
|
* tuple count debugging defines
|
1996-07-09 08:22:35 +02:00
|
|
|
* ----------------
|
|
|
|
*/
|
|
|
|
#ifdef EXEC_TUPLECOUNT
|
1997-09-08 04:41:22 +02:00
|
|
|
extern int NTupleProcessed;
|
|
|
|
extern int NTupleRetrieved;
|
|
|
|
extern int NTupleReplaced;
|
|
|
|
extern int NTupleAppended;
|
|
|
|
extern int NTupleDeleted;
|
|
|
|
extern int NIndexTupleProcessed;
|
|
|
|
extern int NIndexTupleInserted;
|
1997-09-07 07:04:48 +02:00
|
|
|
|
|
|
|
#define IncrRetrieved() NTupleRetrieved++
|
|
|
|
#define IncrAppended() NTupleAppended++
|
|
|
|
#define IncrDeleted() NTupleDeleted++
|
|
|
|
#define IncrReplaced() NTupleReplaced++
|
|
|
|
#define IncrInserted() NTupleInserted++
|
|
|
|
#define IncrProcessed() NTupleProcessed++
|
1996-07-09 08:22:35 +02:00
|
|
|
#define IncrIndexProcessed() NIndexTupleProcessed++
|
1997-09-07 07:04:48 +02:00
|
|
|
#define IncrIndexInserted() NIndexTupleInserted++
|
1996-07-09 08:22:35 +02:00
|
|
|
#else
|
1998-06-15 20:40:05 +02:00
|
|
|
/* stop compiler warnings */
|
|
|
|
#define IncrRetrieved() (void)(0)
|
|
|
|
#define IncrAppended() (void)(0)
|
|
|
|
#define IncrDeleted() (void)(0)
|
|
|
|
#define IncrReplaced() (void)(0)
|
|
|
|
#define IncrInserted() (void)(0)
|
|
|
|
#define IncrProcessed() (void)(0)
|
|
|
|
#define IncrIndexProcessed() (void)(0)
|
|
|
|
#define IncrIndexInserted() (void)(0)
|
1998-09-01 06:40:42 +02:00
|
|
|
#endif /* EXEC_TUPLECOUNT */
|
1996-07-09 08:22:35 +02:00
|
|
|
|
|
|
|
/* ----------------
|
1997-09-07 07:04:48 +02:00
|
|
|
* memory context debugging defines
|
1996-07-09 08:22:35 +02:00
|
|
|
* ----------------
|
|
|
|
*/
|
|
|
|
#ifdef EXEC_CONTEXTDEBUG
|
1997-09-07 07:04:48 +02:00
|
|
|
#define CXT_printf(s) printf(s)
|
|
|
|
#define CXT1_printf(s, a) printf(s, a)
|
1996-07-09 08:22:35 +02:00
|
|
|
#else
|
1997-09-07 07:04:48 +02:00
|
|
|
#define CXT_printf(s)
|
|
|
|
#define CXT1_printf(s, a)
|
1998-09-01 06:40:42 +02:00
|
|
|
#endif /* EXEC_CONTEXTDEBUG */
|
1996-07-09 08:22:35 +02:00
|
|
|
|
|
|
|
/* ----------------
|
1997-09-07 07:04:48 +02:00
|
|
|
* eutils debugging defines
|
1996-07-09 08:22:35 +02:00
|
|
|
* ----------------
|
|
|
|
*/
|
|
|
|
#ifdef EXEC_UTILSDEBUG
|
1999-02-23 08:39:40 +01:00
|
|
|
#define EU_nodeDisplay(l) nodeDisplay(l)
|
1997-09-07 07:04:48 +02:00
|
|
|
#define EU_printf(s) printf(s)
|
|
|
|
#define EU1_printf(s, a) printf(s, a)
|
2000-06-15 02:52:26 +02:00
|
|
|
#define EU2_printf(s, a, b) printf(s, a, b)
|
|
|
|
#define EU3_printf(s, a, b, c) printf(s, a, b, c)
|
1997-09-07 07:04:48 +02:00
|
|
|
#define EU4_printf(s, a, b, c, d) printf(s, a, b, c, d)
|
1996-07-09 08:22:35 +02:00
|
|
|
#else
|
1997-09-07 07:04:48 +02:00
|
|
|
#define EU_nodeDisplay(l)
|
|
|
|
#define EU_printf(s)
|
|
|
|
#define EU1_printf(s, a)
|
1996-11-08 01:46:14 +01:00
|
|
|
#define EU2_printf(s, a, b)
|
|
|
|
#define EU3_printf(s, a, b, c)
|
1997-09-07 07:04:48 +02:00
|
|
|
#define EU4_printf(s, a, b, c, d)
|
1998-09-01 06:40:42 +02:00
|
|
|
#endif /* EXEC_UTILSDEBUG */
|
1996-07-09 08:22:35 +02:00
|
|
|
|
|
|
|
|
|
|
|
/* ----------------
|
1997-09-07 07:04:48 +02:00
|
|
|
* nest loop debugging defines
|
1996-07-09 08:22:35 +02:00
|
|
|
* ----------------
|
|
|
|
*/
|
|
|
|
#ifdef EXEC_NESTLOOPDEBUG
|
1999-02-23 08:39:40 +01:00
|
|
|
#define NL_nodeDisplay(l) nodeDisplay(l)
|
1997-09-07 07:04:48 +02:00
|
|
|
#define NL_printf(s) printf(s)
|
|
|
|
#define NL1_printf(s, a) printf(s, a)
|
|
|
|
#define NL4_printf(s, a, b, c, d) printf(s, a, b, c, d)
|
|
|
|
#define ENL1_printf(message) printf("ExecNestLoop: %s\n", message)
|
1996-07-09 08:22:35 +02:00
|
|
|
#else
|
1997-09-07 07:04:48 +02:00
|
|
|
#define NL_nodeDisplay(l)
|
|
|
|
#define NL_printf(s)
|
|
|
|
#define NL1_printf(s, a)
|
|
|
|
#define NL4_printf(s, a, b, c, d)
|
1996-07-09 08:22:35 +02:00
|
|
|
#define ENL1_printf(message)
|
1998-09-01 06:40:42 +02:00
|
|
|
#endif /* EXEC_NESTLOOPDEBUG */
|
1996-07-09 08:22:35 +02:00
|
|
|
|
|
|
|
/* ----------------
|
1997-09-07 07:04:48 +02:00
|
|
|
* proc node debugging defines
|
1996-07-09 08:22:35 +02:00
|
|
|
* ----------------
|
|
|
|
*/
|
|
|
|
#ifdef EXEC_PROCDEBUG
|
1997-09-07 07:04:48 +02:00
|
|
|
#define PN_printf(s) printf(s)
|
|
|
|
#define PN1_printf(s, p) printf(s, p)
|
1996-07-09 08:22:35 +02:00
|
|
|
#else
|
1997-09-07 07:04:48 +02:00
|
|
|
#define PN_printf(s)
|
|
|
|
#define PN1_printf(s, p)
|
1998-09-01 06:40:42 +02:00
|
|
|
#endif /* EXEC_PROCDEBUG */
|
1996-07-09 08:22:35 +02:00
|
|
|
|
|
|
|
/* ----------------
|
1997-09-07 07:04:48 +02:00
|
|
|
* exec eval / target list debugging defines
|
1996-07-09 08:22:35 +02:00
|
|
|
* ----------------
|
|
|
|
*/
|
|
|
|
#ifdef EXEC_EVALDEBUG
|
1999-02-23 08:39:40 +01:00
|
|
|
#define EV_nodeDisplay(l) nodeDisplay(l)
|
1997-09-07 07:04:48 +02:00
|
|
|
#define EV_printf(s) printf(s)
|
|
|
|
#define EV1_printf(s, a) printf(s, a)
|
1996-07-09 08:22:35 +02:00
|
|
|
#define EV5_printf(s, a, b, c, d, e) printf(s, a, b, c, d, e)
|
|
|
|
#else
|
1997-09-07 07:04:48 +02:00
|
|
|
#define EV_nodeDisplay(l)
|
|
|
|
#define EV_printf(s)
|
|
|
|
#define EV1_printf(s, a)
|
|
|
|
#define EV5_printf(s, a, b, c, d, e)
|
1998-09-01 06:40:42 +02:00
|
|
|
#endif /* EXEC_EVALDEBUG */
|
1996-07-09 08:22:35 +02:00
|
|
|
|
|
|
|
/* ----------------
|
1997-09-07 07:04:48 +02:00
|
|
|
* scan debugging defines
|
1996-07-09 08:22:35 +02:00
|
|
|
* ----------------
|
|
|
|
*/
|
|
|
|
#ifdef EXEC_SCANDEBUG
|
1999-02-23 08:39:40 +01:00
|
|
|
#define S_nodeDisplay(l) nodeDisplay(l)
|
1997-09-07 07:04:48 +02:00
|
|
|
#define S_printf(s) printf(s)
|
|
|
|
#define S1_printf(s, p) printf(s, p)
|
1996-07-09 08:22:35 +02:00
|
|
|
#else
|
1997-09-07 07:04:48 +02:00
|
|
|
#define S_nodeDisplay(l)
|
|
|
|
#define S_printf(s)
|
|
|
|
#define S1_printf(s, p)
|
1998-09-01 06:40:42 +02:00
|
|
|
#endif /* EXEC_SCANDEBUG */
|
1997-09-07 07:04:48 +02:00
|
|
|
|
1996-07-09 08:22:35 +02:00
|
|
|
/* ----------------
|
1997-09-07 07:04:48 +02:00
|
|
|
* sort node debugging defines
|
1996-07-09 08:22:35 +02:00
|
|
|
* ----------------
|
|
|
|
*/
|
|
|
|
#ifdef EXEC_SORTDEBUG
|
1999-02-23 08:39:40 +01:00
|
|
|
#define SO_nodeDisplay(l) nodeDisplay(l)
|
1997-09-07 07:04:48 +02:00
|
|
|
#define SO_printf(s) printf(s)
|
|
|
|
#define SO1_printf(s, p) printf(s, p)
|
1996-07-09 08:22:35 +02:00
|
|
|
#else
|
1997-09-07 07:04:48 +02:00
|
|
|
#define SO_nodeDisplay(l)
|
|
|
|
#define SO_printf(s)
|
|
|
|
#define SO1_printf(s, p)
|
1998-09-01 06:40:42 +02:00
|
|
|
#endif /* EXEC_SORTDEBUG */
|
1996-07-09 08:22:35 +02:00
|
|
|
|
|
|
|
/* ----------------
|
1997-09-07 07:04:48 +02:00
|
|
|
* merge join debugging defines
|
1996-07-09 08:22:35 +02:00
|
|
|
* ----------------
|
|
|
|
*/
|
|
|
|
#ifdef EXEC_MERGEJOINDEBUG
|
1999-02-23 08:39:40 +01:00
|
|
|
|
|
|
|
#define MJ_nodeDisplay(l) nodeDisplay(l)
|
1997-09-07 07:04:48 +02:00
|
|
|
#define MJ_printf(s) printf(s)
|
|
|
|
#define MJ1_printf(s, p) printf(s, p)
|
|
|
|
#define MJ2_printf(s, p1, p2) printf(s, p1, p2)
|
1999-02-23 08:39:40 +01:00
|
|
|
#define MJ_debugtup(tuple, type) debugtup(tuple, type, NULL)
|
2000-09-12 23:07:18 +02:00
|
|
|
#define MJ_dump(state) ExecMergeTupleDump(state)
|
1996-07-09 08:22:35 +02:00
|
|
|
#define MJ_DEBUG_QUAL(clause, res) \
|
|
|
|
MJ2_printf(" ExecQual(%s, econtext) returns %s\n", \
|
1997-09-07 07:04:48 +02:00
|
|
|
CppAsString(clause), T_OR_F(res));
|
|
|
|
|
1996-07-09 08:22:35 +02:00
|
|
|
#define MJ_DEBUG_MERGE_COMPARE(qual, res) \
|
2000-09-12 23:07:18 +02:00
|
|
|
MJ2_printf(" MergeCompare(mergeclauses, %s, ...) returns %s\n", \
|
1997-09-07 07:04:48 +02:00
|
|
|
CppAsString(qual), T_OR_F(res));
|
1996-07-09 08:22:35 +02:00
|
|
|
|
|
|
|
#define MJ_DEBUG_PROC_NODE(slot) \
|
2000-09-12 23:07:18 +02:00
|
|
|
MJ2_printf(" %s = ExecProcNode(...) returns %s\n", \
|
1997-09-07 07:04:48 +02:00
|
|
|
CppAsString(slot), NULL_OR_TUPLE(slot));
|
2000-09-12 23:07:18 +02:00
|
|
|
|
1996-07-09 08:22:35 +02:00
|
|
|
#else
|
2000-09-12 23:07:18 +02:00
|
|
|
|
1996-07-09 08:22:35 +02:00
|
|
|
#define MJ_nodeDisplay(l)
|
1997-09-07 07:04:48 +02:00
|
|
|
#define MJ_printf(s)
|
|
|
|
#define MJ1_printf(s, p)
|
1996-07-09 08:22:35 +02:00
|
|
|
#define MJ2_printf(s, p1, p2)
|
|
|
|
#define MJ_debugtup(tuple, type)
|
2000-09-12 23:07:18 +02:00
|
|
|
#define MJ_dump(state)
|
1996-07-09 08:22:35 +02:00
|
|
|
#define MJ_DEBUG_QUAL(clause, res)
|
|
|
|
#define MJ_DEBUG_MERGE_COMPARE(qual, res)
|
|
|
|
#define MJ_DEBUG_PROC_NODE(slot)
|
1998-09-01 06:40:42 +02:00
|
|
|
#endif /* EXEC_MERGEJOINDEBUG */
|
1996-07-09 08:22:35 +02:00
|
|
|
|
|
|
|
/* ----------------------------------------------------------------
|
1997-09-07 07:04:48 +02:00
|
|
|
* DO NOT DEFINE THESE EVER OR YOU WILL BURN!
|
1996-07-09 08:22:35 +02:00
|
|
|
* ----------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
/* ----------------
|
1997-09-07 07:04:48 +02:00
|
|
|
* NOTYET is placed around any code not yet implemented
|
|
|
|
* in the executor. Only remove these when actually implementing
|
|
|
|
* said code.
|
1996-07-09 08:22:35 +02:00
|
|
|
* ----------------
|
|
|
|
*/
|
|
|
|
#undef NOTYET
|
|
|
|
|
1997-09-08 04:41:22 +02:00
|
|
|
extern long NDirectFileRead;
|
|
|
|
extern long NDirectFileWrite;
|
2001-10-28 07:26:15 +01:00
|
|
|
|
1998-09-01 06:40:42 +02:00
|
|
|
#endif /* ExecDebugIncluded */
|