Обсуждение: pgsql: Add planner support functions for range operators <@ and @>.

Поиск
Список
Период
Сортировка

pgsql: Add planner support functions for range operators <@ and @>.

От
Tom Lane
Дата:
Add planner support functions for range operators <@ and @>.

These support functions will transform expressions with constant
range values into direct comparisons on the range bound values,
which are frequently better-optimizable.  The transformation is
skipped however if it would require double evaluation of a
volatile or expensive element expression.

Along the way, add the range opfamily OID to range typcache entries,
since load_rangetype_info has to compute that anyway and it seems
silly to duplicate the work later.

Kim Johan Andersson and Jian He, reviewed by Laurenz Albe

Discussion: https://postgr.es/m/94f64d1f-b8c0-b0c5-98bc-0793a34e0851@kimmet.dk

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/075df6b2080b13e0a5adc88737b7c24417a873c1

Modified Files
--------------
src/backend/utils/adt/rangetypes.c          | 244 +++++++++++++++++++++++++++-
src/backend/utils/adt/rangetypes_selfuncs.c |   7 +-
src/backend/utils/cache/typcache.c          |   1 +
src/include/catalog/catversion.h            |   2 +-
src/include/catalog/pg_proc.dat             |  14 +-
src/include/utils/typcache.h                |   1 +
src/test/regress/expected/rangetypes.out    | 142 ++++++++++++++++
src/test/regress/sql/rangetypes.sql         |  69 ++++++++
8 files changed, 469 insertions(+), 11 deletions(-)