Re: [GENERAL] Indexing a Bit String column

2009-02-24 Thread George Oakman
in C? Many thanks for your help. George. > To: oakm...@hotmail.com > CC: pgsql-general@postgresql.org > Subject: Re: [GENERAL] Indexing a Bit String column > From: st...@enterprisedb.com > Date: Tue, 24 Feb 2009 15:35:58 + > > > George Oakman writes: &g

Re: [GENERAL] Indexing a Bit String column

2009-02-24 Thread Tom Lane
Gregory Stark writes: > Note that something like "WHERE myBitStringCol & B'101'" might be selecting > too much of your table to make an index useful anyways. If each bit is set in > half the table then you're talking about selecting 3/4 of the table in which > case a full table scan would be more

Re: [GENERAL] Indexing a Bit String column

2009-02-24 Thread Gregory Stark
George Oakman writes: > Is it all I need to do? Will PgSQL know how to index properly a Bit String > column? Should I build the index using a special method, e.g. > CREATE INDEX myBitStringCol_idx ON myTable USING gist(myBitStringCol); No, the default will be to build a btree index which

[GENERAL] Indexing a Bit String column

2009-02-24 Thread George Oakman
Hi all, I am planning to use the Bit String data type for a large number of binary strings, e.g. CREATE TABLE myTable (myBitStringCol BIT(3)); I will need to perform & (bitwise AND) operations using SELECT on this column, e.g. SELECT * FROM myTable WHERE myBitStringCol & B'101' = myB