OT - Query for bit pattern - Mailing list pgsql-jdbc

From Paul Tomblin
Subject OT - Query for bit pattern
Date
Msg-id 47EC50FF.6000407@gmail.com
Whole thread Raw
Responses Re: OT - Query for bit pattern  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-jdbc
If I have a bunch of data where one column in the table is a bitmap, is there
an efficient way to do a query for all the records whose bitmap's first N bits
matches a particular pattern?   Naively, I would store it as an int and do
whatever the sql equivalent of '(hhcode & 0b11110000...) = 0b010100000...)'.
But that is probably horribly inefficient.  Is there a better way?

--
Paul Tomblin <ptomblin@xcski.com> http://blog.xcski.com/
Revenge is an integral part of forgiving and forgetting.
               -- The BOFH

pgsql-jdbc by date:

Previous
From: Oliver Jowett
Date:
Subject: Re: performance issue
Next
From: Tom Lane
Date:
Subject: Re: OT - Query for bit pattern