Re: Bitmasks

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: Bitmasks
Дата
Msg-id 87oe3of9hj.fsf@stark.xeocode.com
обсуждение исходный текст
Ответ на Bitmasks  (Ivan Voras <ivoras@fer.hr>)
Список pgsql-performance
Ivan Voras <ivoras@fer.hr> writes:

> select * from tt where (flags & 16) != 0;
>
> I suspected radix trees could be used for this but it seems it doesn't work
> that way.

You would need a gist index method to make this work. I actually worked on one
for a while and had it working. But it wasn't really finished. If there's
interest I could finish it up and put it up somewhere like pgfoundry.

> If not, is there a way of quickly filtering by such "elements of a set" that
> doesn't involve creating 32 boolean fields (which would also need to be pretty
> uselessly indexed separately)?

You could create 32 partial indexes on some other column which wouldn't really
take much more space than a single index on that other column. But that won't
let you combine them effectively as a gist index would.

--
greg

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

Предыдущее
От: Ivan Voras
Дата:
Сообщение: Bitmasks
Следующее
От: Carlos Benkendorf
Дата:
Сообщение: How much expensive are row level statistics?