Search Postgresql Archives

Re: Fetch from cursor with indexed sorting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Andrey Chursin <andll@xxxxxxxxxxx> 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

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux