]> granicus.if.org Git - postgresql/commitdiff
Subselects...
authorVadim B. Mikheev <vadim4o@yahoo.com>
Fri, 13 Feb 1998 03:46:56 +0000 (03:46 +0000)
committerVadim B. Mikheev <vadim4o@yahoo.com>
Fri, 13 Feb 1998 03:46:56 +0000 (03:46 +0000)
src/include/executor/executor.h
src/include/executor/nodeAgg.h
src/include/executor/nodeHash.h
src/include/executor/nodeHashjoin.h
src/include/executor/nodeMaterial.h
src/include/executor/nodeNestloop.h
src/include/executor/nodeResult.h
src/include/executor/nodeSubplan.h [new file with mode: 0644]
src/include/optimizer/clauses.h
src/include/optimizer/planner.h
src/include/optimizer/subselect.h [new file with mode: 0644]

index e5251886bc59b852d9a9dec899938cfc4f6d8cda..6769c5df76c9fd94f9a0f9174441ac85d7fd2ffd 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Copyright (c) 1994, Regents of the University of California
  *
- * $Id: executor.h,v 1.19 1998/02/10 04:02:19 momjian Exp $
+ * $Id: executor.h,v 1.20 1998/02/13 03:43:33 vadim Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -108,6 +108,7 @@ extern void ExecInitOuterTupleSlot(EState *estate, HashJoinState *hashstate);
 
 extern TupleDesc ExecGetTupType(Plan *node);
 extern TupleDesc ExecTypeFromTL(List *targetList);
+extern void SetChangedParamList (Plan *node, List *newchg);
 
 /*
  * prototypes from functions in execTuples.c
index 69f791b9c9a38b0fef0543f6cd4eff101c4eaed7..ca8de787d17203839bd19adbe3659820225e1f7a 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Copyright (c) 1994, Regents of the University of California
  *
- * $Id: nodeAgg.h,v 1.6 1997/11/26 01:12:40 momjian Exp $
+ * $Id: nodeAgg.h,v 1.7 1998/02/13 03:43:34 vadim Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -21,5 +21,6 @@ extern TupleTableSlot *ExecAgg(Agg *node);
 extern bool ExecInitAgg(Agg *node, EState *estate, Plan *parent);
 extern int     ExecCountSlotsAgg(Agg *node);
 extern void ExecEndAgg(Agg *node);
+extern void ExecReScanAgg(Agg *node, ExprContext *exprCtxt, Plan *parent);
 
 #endif                                                 /* NODEAGG_H */
index 6071eeb874a8df008723cfdaca8cfcd578e987c3..a814c61ed6fe51f5ccad7b4a95b2f4e422ebe329 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Copyright (c) 1994, Regents of the University of California
  *
- * $Id: nodeHash.h,v 1.7 1998/01/24 22:49:01 momjian Exp $
+ * $Id: nodeHash.h,v 1.8 1998/02/13 03:43:35 vadim Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -35,5 +35,6 @@ extern HeapTuple ExecScanHashBucket(HashJoinState *hjstate, HashBucket bucket,
                                   HeapTuple curtuple, List *hjclauses,
                                   ExprContext *econtext);
 extern void ExecHashTableReset(HashJoinTable hashtable, int ntuples);
+extern void ExecReScanHash(Hash *node, ExprContext *exprCtxt, Plan *parent);
 
 #endif                                                 /* NODEHASH_H */
index 2acbddf0384908024f2baaa6d69dddf2e27e6df8..e88e1a67cf4072bf53b93b67ff8e109130120002 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Copyright (c) 1994, Regents of the University of California
  *
- * $Id: nodeHashjoin.h,v 1.7 1998/01/24 22:49:04 momjian Exp $
+ * $Id: nodeHashjoin.h,v 1.8 1998/02/13 03:43:36 vadim Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -23,6 +23,7 @@ extern int    ExecCountSlotsHashJoin(HashJoin *node);
 extern void ExecEndHashJoin(HashJoin *node);
 extern char * ExecHashJoinSaveTuple(HeapTuple heapTuple, char *buffer,
                                          File file, char *position);
+extern void ExecReScanHashJoin(HashJoin *node, ExprContext *exprCtxt, Plan *parent);
 
 
 #endif                                                 /* NODEHASHJOIN_H */
index de010d3ab2186541ff16f591662282b1ea041382..1c612ea4fa457de433b54e5df452dace2c70db42 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Copyright (c) 1994, Regents of the University of California
  *
- * $Id: nodeMaterial.h,v 1.5 1997/11/26 01:12:53 momjian Exp $
+ * $Id: nodeMaterial.h,v 1.6 1998/02/13 03:43:37 vadim Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -21,7 +21,9 @@ extern TupleTableSlot *ExecMaterial(Material *node);
 extern bool ExecInitMaterial(Material *node, EState *estate, Plan *parent);
 extern int     ExecCountSlotsMaterial(Material *node);
 extern void ExecEndMaterial(Material *node);
+extern void ExecMaterialReScan(Material *node, ExprContext *exprCtxt, Plan *parent);
+#if 0
 extern List ExecMaterialMarkPos(Material *node);
 extern void ExecMaterialRestrPos(Material *node);
-
+#endif
 #endif                                                 /* NODEMATERIAL_H */
index ec08d3a9ed84d271fd8870980fcf0b6934f19665..50d2f49820f3ed208de4b2f2aed07a906d7803c9 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Copyright (c) 1994, Regents of the University of California
  *
- * $Id: nodeNestloop.h,v 1.5 1997/11/26 01:12:57 momjian Exp $
+ * $Id: nodeNestloop.h,v 1.6 1998/02/13 03:43:38 vadim Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -21,5 +21,6 @@ extern TupleTableSlot *ExecNestLoop(NestLoop *node, Plan *parent);
 extern bool ExecInitNestLoop(NestLoop *node, EState *estate, Plan *parent);
 extern int     ExecCountSlotsNestLoop(NestLoop *node);
 extern void ExecEndNestLoop(NestLoop *node);
+extern void ExecReScanNestLoop(NestLoop *node, ExprContext *exprCtxt, Plan *parent);
 
 #endif                                                 /* NODENESTLOOP_H */
index e3ebe2241e6ff752c61b86112fb6aa5bae258562..fffdf52e6ab95fca0d510f10be867e27e0cd1882 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Copyright (c) 1994, Regents of the University of California
  *
- * $Id: nodeResult.h,v 1.5 1997/11/26 01:12:58 momjian Exp $
+ * $Id: nodeResult.h,v 1.6 1998/02/13 03:43:39 vadim Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -21,5 +21,6 @@ extern TupleTableSlot *ExecResult(Result *node);
 extern bool ExecInitResult(Result *node, EState *estate, Plan *parent);
 extern int     ExecCountSlotsResult(Result *node);
 extern void ExecEndResult(Result *node);
+extern void ExecReScanResult(Result *node, ExprContext *exprCtxt, Plan *parent);
 
 #endif                                                 /* NODERESULT_H */
diff --git a/src/include/executor/nodeSubplan.h b/src/include/executor/nodeSubplan.h
new file mode 100644 (file)
index 0000000..6fa8945
--- /dev/null
@@ -0,0 +1,20 @@
+/*-------------------------------------------------------------------------
+ *
+ * nodeSubplan.h--
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef NODESUBPLAN_H
+#define NODESUBPLAN_H
+
+#include "executor/tuptable.h"
+#include "nodes/execnodes.h"
+#include "nodes/plannodes.h"
+
+extern Datum ExecSubPlan(SubPlan *node, List *pvar, ExprContext *econtext);
+extern bool ExecInitSubPlan(SubPlan *node, EState *estate, Plan *parent);
+extern void ExecReScanSetParamPlan (SubPlan *node, Plan *parent);
+extern void ExecSetParamPlan (SubPlan *node);
+extern void ExecEndSubPlan(SubPlan *node);
+
+#endif                                                 /* NODESUBPLAN_H */
index 8df238e8ea46811bc9522217f77bc8f90024e976..60ca943fb51fc7f6890da3e6ff4c794958fcf384 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Copyright (c) 1994, Regents of the University of California
  *
- * $Id: clauses.h,v 1.8 1998/01/24 22:49:39 momjian Exp $
+ * $Id: clauses.h,v 1.9 1998/02/13 03:46:54 vadim Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -48,4 +48,8 @@ extern void get_rels_atts(Node *clause, int *relid1,
                          AttrNumber *attno1, int *relid2, AttrNumber *attno2);
 extern void CommuteClause(Node *clause);
 
+#define        is_subplan(clause)      ((Node*) clause != NULL && \
+                                               nodeTag((Node*) clause) == T_Expr && \
+                                               ((Expr *) clause)->opType == SUBPLAN_EXPR)
+
 #endif                                                 /* CLAUSES_H */
index 86b3023aa0172c8560311024457452d4149189c4..38782d3a2c2b45e4e687ccda7ba7e19ee8d4f2eb 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Copyright (c) 1994, Regents of the University of California
  *
- * $Id: planner.h,v 1.7 1997/11/26 01:13:49 momjian Exp $
+ * $Id: planner.h,v 1.8 1998/02/13 03:46:56 vadim Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -21,6 +21,7 @@
 #include "parser/parse_node.h"
 
 extern Plan *planner(Query *parse);
+extern Plan *union_planner(Query *parse);
 extern void pg_checkretval(Oid rettype, QueryTreeList *querytree_list);
 
 #endif                                                 /* PLANNER_H */
diff --git a/src/include/optimizer/subselect.h b/src/include/optimizer/subselect.h
new file mode 100644 (file)
index 0000000..64f9851
--- /dev/null
@@ -0,0 +1,20 @@
+/*-------------------------------------------------------------------------
+ *
+ * subselect.h--
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef SUBSELECT_H
+#define SUBSELECT_H
+
+extern int             PlannerQueryLevel;              /* level of current query */
+extern List       *PlannerVarParam;            /* correlation Vars to Param mapper */
+extern List       *PlannerParamVar;            /* to get Var from Param->paramid */
+extern List       *PlannerInitPlan;            /* init subplans for current query */
+extern int             PlannerPlanId;                  /* to assigne unique ID to subquery plans */
+
+extern List       *SS_finalize_plan (Plan *plan);
+extern Node       *SS_replace_correlation_vars (Node *expr);
+extern Node       *SS_process_sublinks (Node *expr);
+
+#endif                                                 /* SUBSELECT_H */