Re: How to force subquery scan?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: How to force subquery scan?
Дата
Msg-id 6303.1110987712@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: How to force subquery scan?  ("Tambet Matiisen" <t.matiisen@aprote.ee>)
Список pgsql-sql
"Tambet Matiisen" <t.matiisen@aprote.ee> writes:
> It seems that subquery scan is only used, when the query can not be
> translated into single flat query. Which is mostly good, I assume.

The planner thinks so anyway ;-)

If you're desperate you can put in an optimization fence, for instance
LIMIT or OFFSET.
SELECT * FROM (SELECT ... OFFSET 0) ss;

In principle the planner could figure out that this offset is a no-op,
throw it away, and then flatten the query.  But it doesn't at the
moment, and I doubt we'll teach it to do so in the future.
        regards, tom lane


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

Предыдущее
От: "Tambet Matiisen"
Дата:
Сообщение: Re: Parameterized views proposition
Следующее
От: "Moran.Michael"
Дата:
Сообщение: PGCrypto with Integers and DATE types -- how to?