diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2009-10-12 18:10:51 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2009-10-12 18:10:51 +0000 |
commit | 0adaf4cb312fe3eff83e786d6a0b53ae2cdc9302 (patch) | |
tree | 177cf2ea668d6fcabbafc37db4741813ea3f685d /src/backend/optimizer/path/allpaths.c | |
parent | 05d249717d652f0b16960d8a58611e222f1f907b (diff) |
Move the handling of SELECT FOR UPDATE locking and rechecking out of
execMain.c and into a new plan node type LockRows. Like the recent change
to put table updating into a ModifyTable plan node, this increases planning
flexibility by allowing the operations to occur below the top level of the
plan tree. It's necessary in any case to restore the previous behavior of
having FOR UPDATE locking occur before ModifyTable does.
This partially refactors EvalPlanQual to allow multiple rows-under-test
to be inserted into the EPQ machinery before starting an EPQ test query.
That isn't sufficient to fix EPQ's general bogosity in the face of plans
that return multiple rows per test row, though. Since this patch is
mostly about getting some plan node infrastructure in place and not about
fixing ten-year-old bugs, I will leave EPQ improvements for another day.
Another behavioral change that we could now think about is doing FOR UPDATE
before LIMIT, but that too seems like it should be treated as a followon
patch.
Diffstat (limited to 'src/backend/optimizer/path/allpaths.c')
-rw-r--r-- | src/backend/optimizer/path/allpaths.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/backend/optimizer/path/allpaths.c b/src/backend/optimizer/path/allpaths.c index 5b7f0ff0e3f..f6fffec902e 100644 --- a/src/backend/optimizer/path/allpaths.c +++ b/src/backend/optimizer/path/allpaths.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/optimizer/path/allpaths.c,v 1.186 2009/09/17 20:49:28 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/optimizer/path/allpaths.c,v 1.187 2009/10/12 18:10:45 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -632,6 +632,7 @@ set_subquery_pathlist(PlannerInfo *root, RelOptInfo *rel, false, tuple_fraction, &subroot); rel->subrtable = subroot->parse->rtable; + rel->subrowmark = subroot->parse->rowMarks; /* Copy number of output rows from subplan */ rel->tuples = rel->subplan->plan_rows; @@ -971,10 +972,10 @@ standard_join_search(PlannerInfo *root, int levels_needed, List *initial_rels) * since that could change the set of rows returned. * * 2. If the subquery contains any window functions, we can't push quals - * into it, because that would change the results. + * into it, because that could change the results. * * 3. If the subquery contains EXCEPT or EXCEPT ALL set ops we cannot push - * quals into it, because that would change the results. + * quals into it, because that could change the results. * * 4. For subqueries using UNION/UNION ALL/INTERSECT/INTERSECT ALL, we can * push quals into each component query, but the quals can only reference |