diff options
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/commands/explain.h | 5 | ||||
| -rw-r--r-- | src/include/executor/execdesc.h | 5 | ||||
| -rw-r--r-- | src/include/executor/executor.h | 12 | ||||
| -rw-r--r-- | src/include/utils/guc.h | 36 | ||||
| -rw-r--r-- | src/include/utils/guc_tables.h | 24 |
5 files changed, 56 insertions, 26 deletions
diff --git a/src/include/commands/explain.h b/src/include/commands/explain.h index 1006f719382..ca7aefb3895 100644 --- a/src/include/commands/explain.h +++ b/src/include/commands/explain.h @@ -6,7 +6,7 @@ * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group * Portions Copyright (c) 1994-5, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/commands/explain.h,v 1.35 2008/01/01 19:45:57 momjian Exp $ + * $PostgreSQL: pgsql/src/include/commands/explain.h,v 1.36 2008/11/19 01:10:23 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -41,4 +41,7 @@ extern void ExplainOneUtility(Node *utilityStmt, ExplainStmt *stmt, extern void ExplainOnePlan(PlannedStmt *plannedstmt, ParamListInfo params, ExplainStmt *stmt, TupOutputState *tstate); +extern void ExplainPrintPlan(StringInfo str, QueryDesc *queryDesc, + bool analyze, bool verbose); + #endif /* EXPLAIN_H */ diff --git a/src/include/executor/execdesc.h b/src/include/executor/execdesc.h index 4f386029874..2ffccc783f4 100644 --- a/src/include/executor/execdesc.h +++ b/src/include/executor/execdesc.h @@ -8,7 +8,7 @@ * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/executor/execdesc.h,v 1.37 2008/01/01 19:45:57 momjian Exp $ + * $PostgreSQL: pgsql/src/include/executor/execdesc.h,v 1.38 2008/11/19 01:10:23 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -47,6 +47,9 @@ typedef struct QueryDesc TupleDesc tupDesc; /* descriptor for result tuples */ EState *estate; /* executor's query-wide state */ PlanState *planstate; /* tree of per-plan-node state */ + + /* This is always set NULL by the core system, but plugins can change it */ + struct Instrumentation *totaltime; /* total time spent in ExecutorRun */ } QueryDesc; /* in pquery.c */ diff --git a/src/include/executor/executor.h b/src/include/executor/executor.h index 2fdaddda4da..47792df10c9 100644 --- a/src/include/executor/executor.h +++ b/src/include/executor/executor.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/executor/executor.h,v 1.152 2008/10/31 21:07:55 tgl Exp $ + * $PostgreSQL: pgsql/src/include/executor/executor.h,v 1.153 2008/11/19 01:10:23 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -60,12 +60,20 @@ ((*(expr)->evalfunc) (expr, econtext, isNull, isDone)) +/* Hook for plugins to get control in ExecutorStart() */ +typedef void (*ExecutorStart_hook_type) (QueryDesc *queryDesc, int eflags); +extern PGDLLIMPORT ExecutorStart_hook_type ExecutorStart_hook; + /* Hook for plugins to get control in ExecutorRun() */ typedef void (*ExecutorRun_hook_type) (QueryDesc *queryDesc, ScanDirection direction, long count); extern PGDLLIMPORT ExecutorRun_hook_type ExecutorRun_hook; +/* Hook for plugins to get control in ExecutorEnd() */ +typedef void (*ExecutorEnd_hook_type) (QueryDesc *queryDesc); +extern PGDLLIMPORT ExecutorEnd_hook_type ExecutorEnd_hook; + /* * prototypes from functions in execAmi.c @@ -140,11 +148,13 @@ extern HeapTuple ExecRemoveJunk(JunkFilter *junkfilter, TupleTableSlot *slot); * prototypes from functions in execMain.c */ extern void ExecutorStart(QueryDesc *queryDesc, int eflags); +extern void standard_ExecutorStart(QueryDesc *queryDesc, int eflags); extern void ExecutorRun(QueryDesc *queryDesc, ScanDirection direction, long count); extern void standard_ExecutorRun(QueryDesc *queryDesc, ScanDirection direction, long count); extern void ExecutorEnd(QueryDesc *queryDesc); +extern void standard_ExecutorEnd(QueryDesc *queryDesc); extern void ExecutorRewind(QueryDesc *queryDesc); extern void InitResultRelInfo(ResultRelInfo *resultRelInfo, Relation resultRelationDesc, diff --git a/src/include/utils/guc.h b/src/include/utils/guc.h index 87c383e1ebd..e5066677b9f 100644 --- a/src/include/utils/guc.h +++ b/src/include/utils/guc.h @@ -7,7 +7,7 @@ * Copyright (c) 2000-2008, PostgreSQL Global Development Group * Written by Peter Eisentraut <peter_e@gmx.net>. * - * $PostgreSQL: pgsql/src/include/utils/guc.h,v 1.98 2008/07/23 17:29:53 tgl Exp $ + * $PostgreSQL: pgsql/src/include/utils/guc.h,v 1.99 2008/11/19 01:10:23 tgl Exp $ *-------------------------------------------------------------------- */ #ifndef GUC_H @@ -122,6 +122,30 @@ typedef enum #define GUC_QUALIFIER_SEPARATOR '.' +/* + * bit values in "flags" of a GUC variable + */ +#define GUC_LIST_INPUT 0x0001 /* input can be list format */ +#define GUC_LIST_QUOTE 0x0002 /* double-quote list elements */ +#define GUC_NO_SHOW_ALL 0x0004 /* exclude from SHOW ALL */ +#define GUC_NO_RESET_ALL 0x0008 /* exclude from RESET ALL */ +#define GUC_REPORT 0x0010 /* auto-report changes to client */ +#define GUC_NOT_IN_SAMPLE 0x0020 /* not in postgresql.conf.sample */ +#define GUC_DISALLOW_IN_FILE 0x0040 /* can't set in postgresql.conf */ +#define GUC_CUSTOM_PLACEHOLDER 0x0080 /* placeholder for custom variable */ +#define GUC_SUPERUSER_ONLY 0x0100 /* show only to superusers */ +#define GUC_IS_NAME 0x0200 /* limit string to NAMEDATALEN-1 */ + +#define GUC_UNIT_KB 0x0400 /* value is in kilobytes */ +#define GUC_UNIT_BLOCKS 0x0800 /* value is in blocks */ +#define GUC_UNIT_XBLOCKS 0x0C00 /* value is in xlog blocks */ +#define GUC_UNIT_MEMORY 0x0C00 /* mask for KB, BLOCKS, XBLOCKS */ + +#define GUC_UNIT_MS 0x1000 /* value is in milliseconds */ +#define GUC_UNIT_S 0x2000 /* value is in seconds */ +#define GUC_UNIT_MIN 0x4000 /* value is in minutes */ +#define GUC_UNIT_TIME 0x7000 /* mask for MS, S, MIN */ + /* GUC vars that are actually declared in guc.c, rather than elsewhere */ extern bool log_duration; extern bool Debug_print_plan; @@ -164,7 +188,9 @@ extern void DefineCustomBoolVariable( const char *short_desc, const char *long_desc, bool *valueAddr, + bool bootValue, GucContext context, + int flags, GucBoolAssignHook assign_hook, GucShowHook show_hook); @@ -173,9 +199,11 @@ extern void DefineCustomIntVariable( const char *short_desc, const char *long_desc, int *valueAddr, + int bootValue, int minValue, int maxValue, GucContext context, + int flags, GucIntAssignHook assign_hook, GucShowHook show_hook); @@ -184,9 +212,11 @@ extern void DefineCustomRealVariable( const char *short_desc, const char *long_desc, double *valueAddr, + double bootValue, double minValue, double maxValue, GucContext context, + int flags, GucRealAssignHook assign_hook, GucShowHook show_hook); @@ -195,7 +225,9 @@ extern void DefineCustomStringVariable( const char *short_desc, const char *long_desc, char **valueAddr, + const char *bootValue, GucContext context, + int flags, GucStringAssignHook assign_hook, GucShowHook show_hook); @@ -204,8 +236,10 @@ extern void DefineCustomEnumVariable( const char *short_desc, const char *long_desc, int *valueAddr, + int bootValue, const struct config_enum_entry *options, GucContext context, + int flags, GucEnumAssignHook assign_hook, GucShowHook show_hook); diff --git a/src/include/utils/guc_tables.h b/src/include/utils/guc_tables.h index 0eca0f54a3b..338fb27f4ce 100644 --- a/src/include/utils/guc_tables.h +++ b/src/include/utils/guc_tables.h @@ -7,7 +7,7 @@ * * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group * - * $PostgreSQL: pgsql/src/include/utils/guc_tables.h,v 1.43 2008/09/30 10:52:14 heikki Exp $ + * $PostgreSQL: pgsql/src/include/utils/guc_tables.h,v 1.44 2008/11/19 01:10:23 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -129,27 +129,7 @@ struct config_generic int sourceline; /* line in source file */ }; -/* bit values in flags field */ -#define GUC_LIST_INPUT 0x0001 /* input can be list format */ -#define GUC_LIST_QUOTE 0x0002 /* double-quote list elements */ -#define GUC_NO_SHOW_ALL 0x0004 /* exclude from SHOW ALL */ -#define GUC_NO_RESET_ALL 0x0008 /* exclude from RESET ALL */ -#define GUC_REPORT 0x0010 /* auto-report changes to client */ -#define GUC_NOT_IN_SAMPLE 0x0020 /* not in postgresql.conf.sample */ -#define GUC_DISALLOW_IN_FILE 0x0040 /* can't set in postgresql.conf */ -#define GUC_CUSTOM_PLACEHOLDER 0x0080 /* placeholder for custom variable */ -#define GUC_SUPERUSER_ONLY 0x0100 /* show only to superusers */ -#define GUC_IS_NAME 0x0200 /* limit string to NAMEDATALEN-1 */ - -#define GUC_UNIT_KB 0x0400 /* value is in kilobytes */ -#define GUC_UNIT_BLOCKS 0x0800 /* value is in blocks */ -#define GUC_UNIT_XBLOCKS 0x0C00 /* value is in xlog blocks */ -#define GUC_UNIT_MEMORY 0x0C00 /* mask for KB, BLOCKS, XBLOCKS */ - -#define GUC_UNIT_MS 0x1000 /* value is in milliseconds */ -#define GUC_UNIT_S 0x2000 /* value is in seconds */ -#define GUC_UNIT_MIN 0x4000 /* value is in minutes */ -#define GUC_UNIT_TIME 0x7000 /* mask for MS, S, MIN */ +/* bit values in flags field are defined in guc.h */ /* bit values in status field */ #define GUC_IS_IN_FILE 0x0001 /* found it in config file */ |
