Re: Replacing Cursors with Temporary Tables

Поиск
Список
Период
Сортировка
От Merlin Moncure
Тема Re: Replacing Cursors with Temporary Tables
Дата
Msg-id y2kb42b73151004240820u5a0082dt2201eef3c4dafa87@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Replacing Cursors with Temporary Tables  (Grzegorz Jaśkiewicz <gryzman@gmail.com>)
Список pgsql-performance
2010/4/24 Grzegorz Jaśkiewicz <gryzman@gmail.com>:
>
>
> On Sat, Apr 24, 2010 at 2:23 PM, Merlin Moncure <mmoncure@gmail.com> wrote:
>>
>> Well, you missed the most important part: not using cursors at all.
>> Instead of declaring a cursor and looping it to build the array, build
>> it with array().  That's what I've been saying: arrays can completely
>> displace both temp tables _and_ cursors when passing small sets around
>> functions.
>>
> with huge emphasis on the word small.

The rule of thumb I use is 10000 narrow records (scalars, or very
small composites) or 1000 wide/complex records.  I routinely pass
extremely complex (3-4 levels nesting) nested composite arrays to the
client for processing -- it is extremely efficient and clean.  This of
course is going to depend on hardware and other factors.

merlin

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

Предыдущее
От: Grzegorz Jaśkiewicz
Дата:
Сообщение: Re: Replacing Cursors with Temporary Tables
Следующее
От: Vlad Arkhipov
Дата:
Сообщение: Re: Optimization idea