Re: [HACKERS] Index not used on select (Is this more OR + LIKE?)

From: Mike Mascari <mascarim(at)yahoo(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [HACKERS] Index not used on select (Is this more OR + LIKE?)
Date: 1999-07-24 19:02:26
Message-ID: 19990724190226.16280.rocketmail@web135.yahoomail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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(at)yahoo(dot)com

--- Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Mike Mascari <mascarim(at)yahoo(dot)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

Browse pgsql-hackers by date

  From Date Subject
Next Message Oleg Bartunov 1999-07-24 20:14:00 SELECT FOR UPDATE in function
Previous Message Magnus Hagander 1999-07-24 18:34:42 RE: [HACKERS] Re: SSL patch