Re: Query runs forever after upgrading to 9.3

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Query runs forever after upgrading to 9.3
Дата
Msg-id 32607.1384015717@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Query runs forever after upgrading to 9.3  ("Andrus" <kobruleht2@hot.ee>)
Ответы Re: Query runs forever after upgrading to 9.3
Список pgsql-general
"Andrus" <kobruleht2@hot.ee> writes:
> Query
> SELECT * FROM toode
> WHERE toode in (SELECT toode FROM tempkaive)
>      OR toode in (SELECT toode FROM tempalgsemu)

> stops working after upgrading to 9.3 RTM in Windows from earlier version.

Just out of curiosity, what "earlier version" was that that was able to
run this query quickly?  Based on what you've said in this thread, I don't
see a reason for 9.3 to be slower than earlier releases for this.  The
default plan certainly sucks, but that would've been true in earlier
releases as well.

Personally I'd try to get rid of the OR, perhaps with

SELECT * FROM toode
WHERE toode in (SELECT toode FROM tempkaive UNION ALL
                SELECT toode FROM tempalgsemu)

You want to end up with a plan that has no "SubPlans" in it, and in
a quick check this looked promising.

            regards, tom lane


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

Предыдущее
От: Alban Hertroys
Дата:
Сообщение: Re: new line in psotgres
Следующее
От: Scott Marlowe
Дата:
Сообщение: Re: what could cause postgres to crash?