Add planner support functions for range operators <@ and @>.
Tom Lane <tgl@sss.pgh.pa.us>
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
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/utils/adt/rangetypes.c | modified | +240 −4 |
| src/backend/utils/adt/rangetypes_selfuncs.c | modified | +4 −3 |
| src/backend/utils/cache/typcache.c | modified | +1 −0 |
| src/include/catalog/catversion.h | modified | +1 −1 |
| src/include/catalog/pg_proc.dat | modified | +11 −3 |
| src/include/utils/typcache.h | modified | +1 −0 |
| src/test/regress/expected/rangetypes.out | modified | +142 −0 |
| src/test/regress/sql/rangetypes.sql | modified | +69 −0 |
Discussion
- [PATCH] Add support function for containment operators 18 messages · 2023-04-29 → 2024-01-26