pgsql: Restructure function-internal caching in the range type code.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Restructure function-internal caching in the range type code.
Дата
Msg-id E1RQNOq-0001T3-JK@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Restructure function-internal caching in the range type code.

Move the responsibility for caching specialized information about range
types into the type cache, so that the catalog lookups only have to occur
once per session.  Rearrange APIs a bit so that fn_extra caching is
actually effective in the GiST support code.  (Use of OidFunctionCallN is
bad enough for performance in itself, but it also prevents the function
from exploiting fn_extra caching.)

The range I/O functions are still not very bright about caching repeated
lookups, but that seems like material for a separate patch.

Also, avoid unnecessary use of memcpy to fetch/store the range type OID and
flags, and don't use the full range_deserialize machinery when all we need
to see is the flags value.

Also fix API error in range_gist_penalty --- it was failing to set *penalty
for any case involving an empty range.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/37ee4b75db8f979da6d67ba153d068b012394b46

Modified Files
--------------
src/backend/utils/adt/rangetypes.c      |  809 ++++++++++++++-----------------
src/backend/utils/adt/rangetypes_gist.c |  341 ++++++++------
src/backend/utils/cache/typcache.c      |   69 +++
src/include/utils/rangetypes.h          |   69 ++-
src/include/utils/typcache.h            |   14 +
5 files changed, 700 insertions(+), 602 deletions(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: pgsql: Fix alignment and toasting bugs in range types.
Следующее
От: Tom Lane
Дата:
Сообщение: pgsql: Improve caching in range type I/O functions.