pgsql: Rearrange snapshot handling to make rule expansion more consiste

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Rearrange snapshot handling to make rule expansion more consiste
Дата
Msg-id E1PuHC7-0004rk-4t@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
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

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/c0b00760365c74308e9e0719c993eadfbcd090c2

Modified Files
--------------
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 по дате отправления:

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: pgsql: Unbreak vpath builds broken by commit 474a42473adf9b18417242f1fc
Следующее
От: Robert Haas
Дата:
Сообщение: pgsql: Avoid excessive Hot Standby feedback messages.