pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kevin Grittner <Kevin.Grittner@wicourts.gov>
To: W.Alphonse HAROUNY <wharouny@gmail.com>
To: pgsql-performance@postgresql.org
Subject: Re: Index usage when bitwise operator is used
Date: Sun, 16 Sep 2007 18:58:21 -0500
Message-ID: <46ED7CCD.EE98.0025.0@wicourts.gov> (raw)
In-Reply-To: <f97d4e240709130530ve3cc522g61ccca23335618f4@mail.gmail.com>
References: <f97d4e240709130530ve3cc522g61ccca23335618f4@mail.gmail.com>

>>> On Thu, Sep 13, 2007 at  7:30 AM, in message
<f97d4e240709130530ve3cc522g61ccca23335618f4@mail.gmail.com>, "W.Alphonse
HAROUNY" <wharouny@gmail.com> wrote: 

>    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?:
 
  TBL1.CATEGORY = TBL2.CATEGORY
 
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.
 
-Kevin




view thread (10+ messages)  latest in thread

Message-ID: <46ED7CCD.EE98.0025.0@wicourts.gov>
Permalink:  ../46ED7CCD.EE98.0025.0@wicourts.gov/
Also on:    postgresql.org/message-id/46ED7CCD.EE98.0025.0@wicourts.gov

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: Kevin.Grittner@wicourts.gov, wharouny@gmail.com
  Subject: Re: Index usage when bitwise operator is used
  In-Reply-To: <46ED7CCD.EE98.0025.0@wicourts.gov>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox