Re: Postgresq 8,1 hangs when running function

Поиск
Список
Период
Сортировка
От Michael Fuhr
Тема Re: Postgresq 8,1 hangs when running function
Дата
Msg-id 20060821125903.GA24063@winnie.fuhr.org
обсуждение исходный текст
Ответ на Re: Postgresq 8,1 hangs when running function  (Sean Davis <sdavis2@mail.nih.gov>)
Ответы Re: Postgresq 8,1 hangs when running function  ("ben sewell" <mosherben@gmail.com>)
Список pgsql-novice
On Mon, Aug 21, 2006 at 08:37:21AM -0400, Sean Davis wrote:
> If your SQL from your function has the same behavior when you execute it, it
> is likely one of two problems:
>
> 1)  You are doing an unconstrained CROSS JOIN and getting a large result set

Check the parentheses around the OR expressions in the queries'
WHERE clauses.  The queries have their join conditions separated
by AND and then an OR that looks like it needs an extra set of
parentheses.  That is, instead of this:

  AND cond1 AND cond2 AND (cond3 AND cond4) OR (cond5 AND cond6)

try this:

  AND cond1 AND cond2 AND ((cond3 AND cond4) OR (cond5 AND cond6))

or

  AND cond1 AND cond2 AND (cond3 AND cond4 OR cond5 AND cond6)

Otherwise, as Sean said, you're getting cross joins.

--
Michael Fuhr

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

Предыдущее
От: Sean Davis
Дата:
Сообщение: Re: Postgresq 8,1 hangs when running function
Следующее
От: "ben sewell"
Дата:
Сообщение: Re: Postgresq 8,1 hangs when running function