mirror of
https://github.com/postgres/postgres.git
synced 2025-10-27 00:12:01 +03:00
Get rid of some old and crufty global variables in the planner. When
this code was last gone over, there wasn't really any alternative to globals because we didn't have the PlannerInfo struct being passed all through the planner code. Now that we do, we can restructure things to avoid non-reentrancy. I'm fooling with this because otherwise I'd have had to add another global variable for the planned compact range table list.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/include/optimizer/clauses.h,v 1.86 2007/01/22 01:35:22 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/include/optimizer/clauses.h,v 1.87 2007/02/19 07:03:34 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -77,7 +77,7 @@ extern void set_coercionform_dontcare(Node *node);
|
||||
|
||||
extern Node *eval_const_expressions(Node *node);
|
||||
|
||||
extern Node *estimate_expression_value(Node *node);
|
||||
extern Node *estimate_expression_value(PlannerInfo *root, Node *node);
|
||||
|
||||
extern bool expression_tree_walker(Node *node, bool (*walker) (),
|
||||
void *context);
|
||||
|
||||
@@ -7,23 +7,21 @@
|
||||
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/include/optimizer/planner.h,v 1.36 2007/01/05 22:19:56 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/include/optimizer/planner.h,v 1.37 2007/02/19 07:03:34 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
#ifndef PLANNER_H
|
||||
#define PLANNER_H
|
||||
|
||||
#include "nodes/params.h"
|
||||
#include "nodes/parsenodes.h"
|
||||
#include "nodes/plannodes.h"
|
||||
#include "nodes/relation.h"
|
||||
|
||||
|
||||
extern ParamListInfo PlannerBoundParamList; /* current boundParams */
|
||||
|
||||
extern Plan *planner(Query *parse, bool isCursor, int cursorOptions,
|
||||
ParamListInfo boundParams);
|
||||
extern Plan *subquery_planner(Query *parse, double tuple_fraction,
|
||||
List **subquery_pathkeys);
|
||||
extern Plan *subquery_planner(PlannerGlobal *glob, Query *parse,
|
||||
Index level, double tuple_fraction,
|
||||
List **subquery_pathkeys);
|
||||
|
||||
#endif /* PLANNER_H */
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/include/optimizer/subselect.h,v 1.28 2007/01/05 22:19:56 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/include/optimizer/subselect.h,v 1.29 2007/02/19 07:03:34 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -15,16 +15,10 @@
|
||||
#include "nodes/plannodes.h"
|
||||
#include "nodes/relation.h"
|
||||
|
||||
|
||||
extern Index PlannerQueryLevel; /* level of current query */
|
||||
extern List *PlannerInitPlan; /* init subplans for current query */
|
||||
extern List *PlannerParamList; /* to keep track of cross-level Params */
|
||||
extern int PlannerPlanId; /* to assign unique ID to subquery plans */
|
||||
|
||||
extern Node *convert_IN_to_join(PlannerInfo *root, SubLink *sublink);
|
||||
extern Node *SS_replace_correlation_vars(Node *expr);
|
||||
extern Node *SS_process_sublinks(Node *expr, bool isQual);
|
||||
extern void SS_finalize_plan(Plan *plan, List *rtable);
|
||||
extern Node *SS_replace_correlation_vars(PlannerInfo *root, Node *expr);
|
||||
extern Node *SS_process_sublinks(PlannerInfo *root, Node *expr, bool isQual);
|
||||
extern void SS_finalize_plan(PlannerInfo *root, Plan *plan);
|
||||
extern Param *SS_make_initplan_from_plan(PlannerInfo *root, Plan *plan,
|
||||
Oid resulttype, int32 resulttypmod);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user