Re: Index usage when bitwise operator is used

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>>> On Thu, Sep 13, 2007 at  7:30 AM, in message
<f97d4e240709130530ve3cc522g61ccca23335618f4@xxxxxxxxxxxxxx>, "W.Alphonse
HAROUNY" <wharouny@xxxxxxxxx> 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


---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster


[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux