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/executor/README | |
| 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/executor/README')
| -rw-r--r-- | src/backend/executor/README | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/backend/executor/README b/src/backend/executor/README index 2416ac4d42c..06d05d52311 100644 --- a/src/backend/executor/README +++ b/src/backend/executor/README @@ -1,4 +1,4 @@ -$PostgreSQL: pgsql/src/backend/executor/README,v 1.9 2009/10/10 01:43:45 tgl Exp $ +$PostgreSQL: pgsql/src/backend/executor/README,v 1.10 2009/10/12 18:10:41 tgl Exp $ The Postgres Executor ===================== @@ -157,7 +157,8 @@ if need be) and re-evaluate the query qualifications to see if it would still meet the quals. If so, we regenerate the updated tuple (if we are doing an UPDATE) from the modified tuple, and finally update/delete the modified tuple. SELECT FOR UPDATE/SHARE behaves similarly, except that its -action is just to lock the modified tuple. +action is just to lock the modified tuple and return results based on that +version of the tuple. To implement this checking, we actually re-run the entire query from scratch for each modified tuple, but with the scan node that sourced the original @@ -195,5 +196,5 @@ It should be noted also that UPDATE/DELETE expect at most one tuple to result from the modified query, whereas in the FOR UPDATE case it's possible for multiple tuples to result (since we could be dealing with a join in which multiple tuples join to the modified tuple). We want FOR UPDATE to -lock all relevant tuples, so we pass all tuples output by all the stacked -recheck queries back to the executor toplevel for locking. +lock all relevant tuples, so we process all tuples output by all the stacked +recheck queries. |
