Re: explicit cursor vs. for loop in pl/pgsql

Поиск
Список
Период
Сортировка
От David Parker
Тема Re: explicit cursor vs. for loop in pl/pgsql
Дата
Msg-id 07FDEE0ED7455A48AC42AC2070EDFF7C746252@corpsrv2.tazznetworks.com
обсуждение исходный текст
Ответ на explicit cursor vs. for loop in pl/pgsql  ("David Parker" <dparker@tazznetworks.com>)
Список pgsql-general
Thanks for the info. I've got an index, so I guess it's as good as it
gets!

The data is actually copied over from the slony transaction log table,
and there's no way to know how many statements (=rows) there might be
for any given transaction, so assigning an arbitrary limit seems too
risky, and I don't want to take the hit of a select count.

Thanks again.

- DAP

>> The nature of the data is that chunksize doesn't necessarily
>match up
>> one-for-one with rows, so I can't use it as a LIMIT value.
>
>Can you set an upper bound on how many rows you need?  If you
>can put a LIMIT into the select, it'll encourage the planner
>to use an indexscan, even if you break out of the loop before
>the limit is reached.
>
>            regards, tom lane
>

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: explicit cursor vs. for loop in pl/pgsql
Следующее
От: Jerry Sievers
Дата:
Сообщение: CSV delim quoting differences PgCOPY, Excel etc...