Re: bitmask index

Поиск
Список
Период
Сортировка
От Greg Smith
Тема Re: bitmask index
Дата
Msg-id 4E0261C1.8000807@2ndQuadrant.com
обсуждение исходный текст
Ответ на bitmask index  (Marcus Engene <mengpg2@engene.se>)
Ответы Re: bitmask index  (Robert Klemme <shortcutter@googlemail.com>)
Re: bitmask index  (Marcus Engene <mengpg2@engene.se>)
Список pgsql-performance
On 06/22/2011 05:27 PM, Marcus Engene wrote:
> I have some tables with bitmask integers. Set bits are the interesting
> ones. Usually they are sparse.

If it's sparse, create a partial index that just includes rows where the
bit is set:
http://www.postgresql.org/docs/current/static/indexes-partial.html

You need to be careful the query uses the exact syntax as the one that
created the index for it to be used.  But if you do that, it should be
able to pull the rows that match out quickly.

--
Greg Smith   2ndQuadrant US    greg@2ndQuadrant.com   Baltimore, MD
PostgreSQL Training, Services, and 24x7 Support  www.2ndQuadrant.us
"PostgreSQL 9.0 High Performance": http://www.2ndQuadrant.com/books


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

Предыдущее
От: Greg Smith
Дата:
Сообщение: Re: seq scan in the case of max() on the primary key column
Следующее
От: Robert Klemme
Дата:
Сообщение: Re: bitmask index