diff options
Diffstat (limited to 'src/backend/optimizer/plan/planmain.c')
-rw-r--r-- | src/backend/optimizer/plan/planmain.c | 42 |
1 files changed, 1 insertions, 41 deletions
diff --git a/src/backend/optimizer/plan/planmain.c b/src/backend/optimizer/plan/planmain.c index 29cfccfef7b..a9747b32799 100644 --- a/src/backend/optimizer/plan/planmain.c +++ b/src/backend/optimizer/plan/planmain.c @@ -14,7 +14,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planmain.c,v 1.60 2000/09/29 18:21:33 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planmain.c,v 1.61 2000/10/05 19:11:29 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -174,8 +174,6 @@ subplanner(Query *root, List *brel; RelOptInfo *final_rel; Plan *resultplan; - MemoryContext mycontext; - MemoryContext oldcxt; Path *cheapestpath; Path *presortedpath; @@ -228,24 +226,6 @@ subplanner(Query *root, root->query_pathkeys = canonicalize_pathkeys(root, root->query_pathkeys); /* - * We might allocate quite a lot of storage during planning (due to - * constructing lots of Paths), but all of it can be reclaimed after - * we generate the finished Plan tree. Work in a temporary context - * to let that happen. We make the context a child of - * TransactionCommandContext so it will be freed if error abort. - * - * Note: beware of trying to move this up to the start of this routine. - * Some of the data structures built above --- notably the pathkey - * equivalence sets --- will still be needed after this routine exits. - */ - mycontext = AllocSetContextCreate(TransactionCommandContext, - "Planner", - ALLOCSET_DEFAULT_MINSIZE, - ALLOCSET_DEFAULT_INITSIZE, - ALLOCSET_DEFAULT_MAXSIZE); - oldcxt = MemoryContextSwitchTo(mycontext); - - /* * Ready to do the primary planning. */ final_rel = make_one_rel(root); @@ -355,25 +335,5 @@ subplanner(Query *root, plan_built: - /* - * Must copy the completed plan tree and its pathkeys out of temporary - * context. We also have to copy the rtable in case it contains any - * subqueries. (If it does, they'll have been modified during the - * recursive invocation of planner.c, and hence will contain substructure - * allocated in my temporary context...) - */ - MemoryContextSwitchTo(oldcxt); - - resultplan = copyObject(resultplan); - - root->query_pathkeys = copyObject(root->query_pathkeys); - - root->rtable = copyObject(root->rtable); - - /* - * Now we can release the Path storage. - */ - MemoryContextDelete(mycontext); - return resultplan; } |