Re: FETCH in subqueries or CTEs

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: FETCH in subqueries or CTEs
Дата
Msg-id 20128.1345818675@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: FETCH in subqueries or CTEs  (Craig Ringer <ringerc@ringerc.id.au>)
Ответы Re: FETCH in subqueries or CTEs  (Craig Ringer <ringerc@ringerc.id.au>)
Список pgsql-general
Craig Ringer <ringerc@ringerc.id.au> writes:
> I didn't find a reasonable way to simply fetch a cursor into a (possibly
> temporary) table, like:
> INSERT INTO sometable FETCH ALL FROM somecursor;

Why would you bother with a cursor, and not just INSERT ... SELECT
using the original query?

Putting a cursor in between will just make matters more complicated and
slower.  (For one thing, the plan created for a cursor is optimized for
incremental fetching not read-it-all-at-once.)

            regards, tom lane


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

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: FETCH in subqueries or CTEs
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Rules, Windows and ORDER BY