Re: subqueries

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: subqueries
Дата
Msg-id 7183.1119224766@sss.pgh.pa.us
обсуждение исходный текст
Ответ на subqueries  (Tomasz Grobelny <tomasz@grobelny.oswiecenia.net>)
Список pgsql-general
Tomasz Grobelny <tomasz@grobelny.oswiecenia.net> writes:
> I have such a statement:
> select * from (subquery1) as foo, (subquery2) as bar;
> Both subqueries are reasonably fast (<0.5s) and generate results that have
> several (<10) rows but the whole query takes forever to execute.

The above is an unconstrained join: you are asking for the cross product
of the two subqueries.  It seems unlikely that that is what you really
want.  Perhaps you meant "subquery1 UNION ALL subquery2"?

            regards, tom lane

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

Предыдущее
От: "Andres"
Дата:
Сообщение: Insert behavior in transaction
Следующее
От: "Grant Morgan"
Дата:
Сообщение: unicode and =