Received: from localhost (unknown [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id E14089F95C1 for ; Sun, 16 Sep 2007 20:58:41 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 10592-06 for ; Sun, 16 Sep 2007 20:58:34 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from gwmta.wicourts.gov (gwmta.wicourts.gov [165.219.244.99]) by postgresql.org (Postfix) with ESMTP id 979959F95B3 for ; Sun, 16 Sep 2007 20:58:38 -0300 (ADT) Received: from Courts-MTA by gwmta.wicourts.gov with Novell_GroupWise; Sun, 16 Sep 2007 18:58:37 -0500 Message-Id: <46ED7CCD.EE98.0025.0@wicourts.gov> X-Mailer: Novell GroupWise Internet Agent 7.0.2 Date: Sun, 16 Sep 2007 18:58:21 -0500 From: "Kevin Grittner" To: "W.Alphonse HAROUNY" , Subject: Re: Index usage when bitwise operator is used References: In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200709/283 X-Sequence-Number: 26828 >>> On Thu, Sep 13, 2007 at 7:30 AM, in message , "W.Alphonse HAROUNY" wrote:=20 > and each binary value of [variableCategory] may only hold a single = binary > '1'. > TBL1.CATEGORY & TBL2.CATEGORY <> 0 //-- where & is the AND bitwise > operator What about saying?: =20 TBL1.CATEGORY =3D TBL2.CATEGORY =20 If your indexes include this and the other columns which cause the tables to be related, one or both of them stand a pretty good chance of evaluating= to the lowest-cost method to join the tables. Forcing a query to use an index outside of it being the cheapest path is rarely productive. =20 -Kevin