Rearrange snapshot handling to make rule expansion more consistent.
With this patch, portals, SQL functions, and SPI all agree that there
should be only a CommandCounterIncrement between the queries that are
generated from a single SQL command by rule expansion. Fetching a whole
new snapshot now happens only between original queries. This is equivalent
to the existing behavior of EXPLAIN ANALYZE, and it was judged to be the
best choice since it eliminates one source of concurrency hazards for
rules. The patch should also make things marginally faster by reducing the
number of snapshot push/pop operations.
The patch removes pg_parse_and_rewrite(), which is no longer used anywhere.
There was considerable discussion about more aggressive refactoring of the
query-processing functions exported by postgres.c, but for the moment
nothing more has been done there.
I also took the opportunity to refactor snapmgr.c's API slightly: the
former PushUpdatedSnapshot() has been split into two functions.
Marko Tiikkaja, reviewed by Steve Singer and Tom Lane
src/backend/catalog/pg_proc.c | 27 +++-
src/backend/commands/copy.c | 3 +-
src/backend/commands/explain.c | 3 +-
src/backend/executor/functions.c | 348 ++++++++++++++++++++++++++-----------
src/backend/executor/spi.c | 96 ++++++-----
src/backend/tcop/postgres.c | 41 -----
src/backend/tcop/pquery.c | 52 +++++--
src/backend/utils/time/snapmgr.c | 33 +++--
src/include/tcop/tcopprot.h | 2 -
src/include/utils/snapmgr.h | 3 +-
10 files changed, 390 insertions(+), 218 deletions(-)
pgsql-committers by date
|Next:||From: Robert Haas||Date: 2011-03-01 16:34:30|
|Subject: pgsql: Avoid excessive Hot Standby feedback messages.|
|Previous:||From: Andrew Dunstan||Date: 2011-03-01 02:31:57|
|Subject: pgsql: Unbreak vpath builds broken by commit474a42473adf9b18417242f1fc|