| От | Teodor Sigaev |
|---|---|
| Тема | btree_gin and ranges |
| Дата | |
| Msg-id | 54478D0A.9050309@sigaev.ru обсуждение исходный текст |
| Ответы |
Re: btree_gin and ranges
Re: btree_gin and ranges |
| Список | pgsql-hackers |
Suggested patch adds GIN support contains operator for ranges over scalar column.
It allows more effective GIN scan. Currently, queries like
SELECT * FROM test_int4 WHERE i <= 1 and i >= 1
will be excuted by GIN with two scans: one is from mines infinity to 1 and
another is from -1 to plus infinity. That's because GIN is "generalized" and it
doesn't know a semantics of operation.
With patch it's possible to rewrite query with ranges
SELECT * FROM test_int4 WHERE i <@ '[-1, 1]'::int4range
and GIN index will support this query with single scan from -1 to 1.
Patch provides index support only for existing range types: int4, int8, numeric,
date and timestamp with and without time zone.
--
Teodor Sigaev E-mail: teodor@sigaev.ru
WWW: http://www.sigaev.ru/
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера