btree_gin and ranges

Поиск
Список
Период
Сортировка
От 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 по дате отправления:

Предыдущее
От: David Rowley
Дата:
Сообщение: Re: [PATCH] Simplify EXISTS subqueries containing LIMIT
Следующее
От: Marti Raudsepp
Дата:
Сообщение: Re: btree_gin and ranges