mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-27 08:39:28 +08:00
e6faf910d7
Rewrite plancache.c so that a "cached plan" (which is rather a misnomer at this point) can support generation of custom, parameter-value-dependent plans, and can make an intelligent choice between using custom plans and the traditional generic-plan approach. The specific choice algorithm implemented here can probably be improved in future, but this commit is all about getting the mechanism in place, not the policy. In addition, restructure the API to greatly reduce the amount of extraneous data copying needed. The main compromise needed to make that possible was to split the initial creation of a CachedPlanSource into two steps. It's worth noting in particular that SPI_saveplan is now deprecated in favor of SPI_keepplan, which accomplishes the same end result with zero data copying, and no need to then spend even more cycles throwing away the original SPIPlan. The risk of long-term memory leaks while manipulating SPIPlans has also been greatly reduced. Most of this improvement is based on use of the recently-added MemoryContextSetParent primitive. |
||
---|---|---|
.. | ||
autoinc--1.0.sql | ||
autoinc--unpackaged--1.0.sql | ||
autoinc.c | ||
autoinc.control | ||
autoinc.example | ||
insert_username--1.0.sql | ||
insert_username--unpackaged--1.0.sql | ||
insert_username.c | ||
insert_username.control | ||
insert_username.example | ||
Makefile | ||
moddatetime--1.0.sql | ||
moddatetime--unpackaged--1.0.sql | ||
moddatetime.c | ||
moddatetime.control | ||
moddatetime.example | ||
refint--1.0.sql | ||
refint--unpackaged--1.0.sql | ||
refint.c | ||
refint.control | ||
refint.example | ||
timetravel--1.0.sql | ||
timetravel--unpackaged--1.0.sql | ||
timetravel.c | ||
timetravel.control | ||
timetravel.example |