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

Поиск
Список
Период
Сортировка
От Mike Mascari
Тема Re: [HACKERS] Index not used on select (Is this more OR + LIKE?)
Дата
Msg-id 19990724190226.16280.rocketmail@web135.yahoomail.com
обсуждение исходный текст
Список 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@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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Magnus Hagander
Дата:
Сообщение: RE: [HACKERS] Re: SSL patch
Следующее
От: Oleg Bartunov
Дата:
Сообщение: SELECT FOR UPDATE in function