> For reference, I was having SEVERE performance problems with the
> following comparison in an SQL statement where "mask" was an integer:
> "select ... from .... where ...... and (permission & mask = permission)"
AFAIK, the only way to use an index on these queries is through
expression indexes. That's why a lot of folks use INTARRAY instead; it
comes with a GIN index type.
It would probably be possible to create a new index type using GiST or
GIN which indexed bitstrings automatically, but I don't know that anyone
has done it yet.
Changing your integer to a bitstring will not, to my knowledge, improve
PostgreSQL Experts Inc.
In response to
pgsql-performance by date
|Next:||From: Merlin Moncure||Date: 2009-09-05 20:09:07|
|Subject: Re: Planner question - "bit" data types|
|Previous:||From: Kevin Grittner||Date: 2009-09-04 22:09:37|
|Subject: Re: Seeking performance advice and explanation for high I/O on 8.3|