| От | Tom Lane |
|---|---|
| Тема | Re: Indexing a Bit String column |
| Дата | |
| Msg-id | 9271.1235490398@sss.pgh.pa.us обсуждение |
| Ответ на | Re: Indexing a Bit String column (Gregory Stark <stark@enterprisedb.com>) |
| Список | pgsql-general |
Gregory Stark <stark@enterprisedb.com> writes:
> Note that something like "WHERE myBitStringCol & B'101'" might be selecting
> too much of your table to make an index useful anyways. If each bit is set in
> half the table then you're talking about selecting 3/4 of the table in which
> case a full table scan would be more efficient than any index.
If the expectation is that the bitstring is mostly zeroes, I wonder
whether the OP wouldn't be better off using an integer-array
representation, ie instead of '00000101' store '{6,8}'. Then he could
use the existing GIST or GIN support for integer array operations.
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера