Received: from exchange.hq.openratings.com (adsl-141-154-210-2.ba-dsg.net [141.154.210.2]) by postgresql.org (Postfix) with ESMTP id ADD97476A8B; Fri, 15 Mar 2002 19:21:43 -0500 (EST) Received: from openratings.com (cancun.hq.openratings.com [10.0.0.225]) by exchange.hq.openratings.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id GPKPL50K; Fri, 15 Mar 2002 19:22:02 -0500 Message-ID: <3C92A500.5010804@openratings.com> Date: Fri, 15 Mar 2002 20:50:56 -0500 From: Dmitry Tkach User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.7+) Gecko/20020123 X-Accept-Language: en-us MIME-Version: 1.0 To: fcanedo@hotpop.com Cc: pgsql-general@postgresql.org, pgsql-sql@postgresql.org Subject: Re: Btree index extension question References: Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit X-Archive-Number: 200203/857 X-Sequence-Number: 22229 fcanedo@hotpop.com wrote: > > >I understand this: >1. You want to use a btree index because presumably it's faster than a >normal index. > Ahhh.. What do you mean by 'normal index'? I have two reasons to use btree: - It is simpler to implement; - It can be used in combination with other columns (these 15 boolean flags is not the only stuff I need to search by, so, I am going to have to run queries like '... where flags & 33 = 33 and foo=bar'' - to do that, I would need an index on (flags 'bit_ops', foo), where bit_ops is my special set of operations I am looking to define). If I am not using btree for the flags, I would then have to define the whole indexing strategy for all my columns, and I am really hoping to be able to avoid having to do that. > >2. A btree index is a binary tree index that uses the order of values to >find an answer quickly. > Yep. > >3. In your case for instance: a value of 10 should produce a resultset >with bitstrings of 10, 11, 14, 26, ... > Yep. > >Wouldn't know how to get this to work though! :( > Yeah... me neither :-( I am about to give up on this (hate to do that!)... I was trying to make use of a GiST index now, but having some problems with that too :-( Could you please look at the next message I am about to post in a few minutes (about debugging C functions)? Perhaps, you would have some helpful ideas there? Thanks! Dima