| От | Tom Lane |
|---|---|
| Тема | Re: Find out the number of rows returned by refcursor? |
| Дата | |
| Msg-id | 28840.1160591468@sss.pgh.pa.us обсуждение |
| Ответ на | Re: Find out the number of rows returned by refcursor? ("Karen Hill" <karen_hill22@yahoo.com>) |
| Ответы |
Re: Find out the number of rows returned by refcursor?
|
| Список | pgsql-general |
"Karen Hill" <karen_hill22@yahoo.com> writes:
> -- Is there a way to know the total number of rows the cursor is
> capable of traversing without using --count?
If you want an accurate count, the only way is to traverse the cursor.
Consider using MOVE FORWARD ALL and noting the rowcount, then MOVE
BACKWARD ALL to reset the cursor (the latter at least should be
reasonably cheap).
If you can settle for a (potentially very inaccurate) estimate, consider
using EXPLAIN on the query and noting the planner's rowcount estimate.
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера