Re: Fetch from cursor with indexed sorting

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Fetch from cursor with indexed sorting
Дата
Msg-id 20193.1331823160@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Fetch from cursor with indexed sorting  (Andrey Chursin <andll@danasoft.ws>)
Список pgsql-general
Andrey Chursin <andll@danasoft.ws> writes:
> I need to create cursor, open it, fetch records one-by-one and
> aggregate. Then on some condition I stop fetching and return
> aggregated value. In fact in most cases my procedure scans a little
> part of table.

> But does postgres understand such usage of index and cursors?

Not unless you tell it.  You may need to reduce the value of
cursor_tuple_fraction to inform the planner that you're only expecting
to fetch a small part of the cursor's theoretical output.

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: yum repository packages 9.0 and 9.1 libpq conflict
Следующее
От: "Albe Laurenz"
Дата:
Сообщение: Re: Backups