X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 563585281E for ; Fri, 17 Jun 2005 02:04:25 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 05349-01 for ; Fri, 17 Jun 2005 05:04:23 +0000 (GMT) Received: from hub.org (hub.org [200.46.204.220]) by svr1.postgresql.org (Postfix) with ESMTP id 84DC552824 for ; Fri, 17 Jun 2005 02:04:23 -0300 (ADT) Received: from localhost (unknown [200.46.204.144]) by hub.org (Postfix) with ESMTP id C731A64BE88 for ; Fri, 17 Jun 2005 02:04:22 -0300 (ADT) Received: from hub.org ([200.46.204.220]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 01816-08; Fri, 17 Jun 2005 05:04:11 +0000 (GMT) Received: from ganymede.hub.org (blk-224-176-51.eastlink.ca [24.224.176.51]) by hub.org (Postfix) with ESMTP id A877A64BE87; Fri, 17 Jun 2005 02:04:12 -0300 (ADT) Received: by ganymede.hub.org (Postfix, from userid 1000) id 2A3B73D576; Fri, 17 Jun 2005 02:04:12 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by ganymede.hub.org (Postfix) with ESMTP id 26CDC3CC2F; Fri, 17 Jun 2005 02:04:12 -0300 (ADT) Date: Fri, 17 Jun 2005 02:04:12 -0300 (ADT) From: "Marc G. Fournier" X-X-Sender: scrappy@ganymede.hub.org To: Tom Lane Cc: pgsql-sql@postgresql.org Subject: Re: Putting an INDEX on a boolean field? In-Reply-To: <15887.1118983309@sss.pgh.pa.us> Message-ID: <20050617020039.P90456@ganymede.hub.org> References: <20050617011336.Q90456@ganymede.hub.org> <15887.1118983309@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: by amavisd-new at hub.org X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.292 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200506/214 X-Sequence-Number: 21815 On Fri, 17 Jun 2005, Tom Lane wrote: > "Marc G. Fournier" writes: >> Does that make sense? Would it ever get used? > > It could get used if one of the two values is far less frequent than the > other. Personally I'd think about a partial index instead ... Hrmmmm, hadn't thought of that ... wouldn't you have to build two indexes (one for true, one for false) for this to be completely effective? unless you know all your queries are going to search for one, but not the other? ---- Marc G. Fournier Hub.Org Networking Services (http://www.hub.org) Email: scrappy@hub.org Yahoo!: yscrappy ICQ: 7615664