From: Greg Stark <gsstark@mit.edu>
To: Ivan Voras <ivoras@fer.hr>
Cc: pgsql-performance@postgresql.org
Subject: Re: Bitmasks
Date: 11 Dec 2005 01:12:08 -0500
Message-ID: <87oe3of9hj.fsf@stark.xeocode.com> (raw)
In-Reply-To: <439B0C9A.6010109@fer.hr>
References: <439B0C9A.6010109@fer.hr>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: gsstark@mit.edu, ivoras@fer.hr
Subject: Re: Bitmasks
In-Reply-To: <87oe3of9hj.fsf@stark.xeocode.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox