Bitmasks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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?


[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux