Thanks Tom,

You were correct, as always.  The query was wrong. 
I apologize for wasting your time.  I needed to 
encase the chained OR clauses in parens...I'll try 
and purge that Slip.

Sorry,

Mike Mascari
mascarim@yahoo.com

--- Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Mike Mascari <mascarim@yahoo.com> writes:
> > ...  However, if an OR clause is introduced as
> below:

> I think the problem is that the OR appears at top
> level in the WHERE
> clause (assuming the above is a verbatim transcript
> of your query).
> OR groups less tightly than AND, so what this really
> means is
> 	(other-conditions AND (LIKEs-for-SEQ)) OR
> (LIKEs-for-SCD)
> which is undoubtedly not what you had in mind, and
> will certainly
> produce a lot of unwanted records if the query
> manages to complete.
> Every supplies tuple matching SCD will appear joined
> to every possible
> combination of records from the other tables...In
the
> mistaken version, they get evaluated for every
> possible combination
> of joined tuples...
> 
> 			regards, tom lane
> 

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


Sat, 24 Jul 1999 15:02:26 -0400 (EDT)
Mike Mascari <mascarim@yahoo.com>
Re: [HACKERS] Index not used on select (Is this more OR + LIKE?) 