Bitmasks - Mailing list pgsql-performance

From Ivan Voras
Subject Bitmasks
Date
Msg-id 439B0C9A.6010109@fer.hr
Whole thread Raw
Responses Re: Bitmasks
List pgsql-performance
Can indexes be used for bit-filtering queries? For example:

create table tt (
   flags integer not null default 0,
   str   varchar
);

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.

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)?

Would strings and regular expressions work?

pgsql-performance by date:

Previous
From: Manfred Koizar
Date:
Subject: Re: Queries taking ages in PG 8.1, have been much faster in PG<=8.0
Next
From: Greg Stark
Date:
Subject: Re: Bitmasks