postgresql/src/backend/commands
Tom Lane 9f2ee8f287 Re-implement EvalPlanQual processing to improve its performance and eliminate
a lot of strange behaviors that occurred in join cases.  We now identify the
"current" row for every joined relation in UPDATE, DELETE, and SELECT FOR
UPDATE/SHARE queries.  If an EvalPlanQual recheck is necessary, we jam the
appropriate row into each scan node in the rechecking plan, forcing it to emit
only that one row.  The former behavior could rescan the whole of each joined
relation for each recheck, which was terrible for performance, and what's much
worse could result in duplicated output tuples.

Also, the original implementation of EvalPlanQual could not re-use the recheck
execution tree --- it had to go through a full executor init and shutdown for
every row to be tested.  To avoid this overhead, I've associated a special
runtime Param with each LockRows or ModifyTable plan node, and arranged to
make every scan node below such a node depend on that Param.  Thus, by
signaling a change in that Param, the EPQ machinery can just rescan the
already-built test plan.

This patch also adds a prohibition on set-returning functions in the
targetlist of SELECT FOR UPDATE/SHARE.  This is needed to avoid the
duplicate-output-tuple problem.  It seems fairly reasonable since the
other restrictions on SELECT FOR UPDATE are meant to ensure that there
is a unique correspondence between source tuples and result tuples,
which an output SRF destroys as much as anything else does.
2009-10-26 02:26:45 +00:00
..
aggregatecmds.c Support use of function argument names to identify which actual arguments 2009-10-08 02:39:25 +00:00
alter.c Update copyright for 2009. 2009-01-01 17:24:05 +00:00
analyze.c Fix old bug in log_autovacuum_min_duration code: it was relying on being able 2009-08-12 18:23:49 +00:00
async.c Create a multiplexing structure for signals to Postgres child processes. 2009-07-31 20:26:23 +00:00
cluster.c Create an ALTER DEFAULT PRIVILEGES command, which allows users to adjust 2009-10-05 19:24:49 +00:00
comment.c CREATE LIKE INCLUDING COMMENTS and STORAGE, and INCLUDING ALL shortcut. Itagaki Takahiro. 2009-10-12 19:49:24 +00:00
constraint.c Support deferrable uniqueness constraints. 2009-07-29 20:56:21 +00:00
conversioncmds.c 8.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef list 2009-06-11 14:49:15 +00:00
copy.c Define a new, more extensible syntax for COPY options. 2009-09-21 20:10:21 +00:00
dbcommands.c Make it possibly to specify GUC params per user and per database. 2009-10-07 22:14:26 +00:00
define.c Define a new, more extensible syntax for COPY options. 2009-09-21 20:10:21 +00:00
discard.c Update copyright for 2009. 2009-01-01 17:24:05 +00:00
explain.c Move the handling of SELECT FOR UPDATE locking and rechecking out of 2009-10-12 18:10:51 +00:00
foreigncmds.c 8.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef list 2009-06-11 14:49:15 +00:00
functioncmds.c Support use of function argument names to identify which actual arguments 2009-10-08 02:39:25 +00:00
indexcmds.c Support deferrable uniqueness constraints. 2009-07-29 20:56:21 +00:00
lockcmds.c 8.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef list 2009-06-11 14:49:15 +00:00
Makefile Support deferrable uniqueness constraints. 2009-07-29 20:56:21 +00:00
opclasscmds.c Update copyright for 2009. 2009-01-01 17:24:05 +00:00
operatorcmds.c 8.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef list 2009-06-11 14:49:15 +00:00
portalcmds.c Fix snapshot management, take two. 2009-10-07 16:27:18 +00:00
prepare.c Extend EXPLAIN to support output in XML or JSON format. 2009-08-10 05:46:50 +00:00
proclang.c Implement the DO statement to support execution of PL code without having 2009-09-22 23:43:43 +00:00
schemacmds.c 8.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef list 2009-06-11 14:49:15 +00:00
sequence.c Code review for LIKE INCLUDING patch --- clean up some cosmetic and not 2009-10-13 00:53:08 +00:00
tablecmds.c Support SQL-compliant triggers on columns, ie fire only if certain columns 2009-10-14 22:14:25 +00:00
tablespace.c Install a hopefully-temporary workaround for Snow Leopard readdir() bug. 2009-09-12 15:51:52 +00:00
trigger.c Re-implement EvalPlanQual processing to improve its performance and eliminate 2009-10-26 02:26:45 +00:00
tsearchcmds.c Support use of function argument names to identify which actual arguments 2009-10-08 02:39:25 +00:00
typecmds.c Support use of function argument names to identify which actual arguments 2009-10-08 02:39:25 +00:00
user.c Make it possibly to specify GUC params per user and per database. 2009-10-07 22:14:26 +00:00
vacuum.c Re-implement EvalPlanQual processing to improve its performance and eliminate 2009-10-26 02:26:45 +00:00
vacuumlazy.c Fix a violation of WAL coding rules in the recent patch to include an 2009-08-24 02:18:32 +00:00
variable.c Disallow RESET ROLE and RESET SESSION AUTHORIZATION inside security-definer 2009-09-03 22:08:05 +00:00
view.c Code review for LIKE INCLUDING patch --- clean up some cosmetic and not 2009-10-13 00:53:08 +00:00