Cursors - Mailing list pgsql-admin

From Natalie Wenz
Subject Cursors
Date
Msg-id 0E01B4A9-D944-4300-8A56-FC14DFFAB999@gmail.com
Whole thread Raw
Responses Re: Cursors  (Laurenz Albe <laurenz.albe@cybertec.at>)
List pgsql-admin
I have a couple of general questions regarding cursors.

First, does something like this hold open one transaction, or is each fetch a separate transaction? As a dba I'm
wonderingif this would interfere with maintenance operations (xid rolling via autovacuum, attaching/detaching
partitions,etc). 

declare cursname no scroll cursor without hold for ...
fetch forward 50000 from cursname


Secondly, on this particular thing (it's a three-table join, with one of those tables being very "wide", so there's
definitelya pg_toast table that's involved besides), it seems to perform pretty terribly. What are the advantages of
gatheringrecords this way compared to doing a series of queries with a range (record number >= x and record number <
y)? 

Thanks for your help!
Natalie

pgsql-admin by date:

Previous
From: Scott Ribe
Date:
Subject: Re: How to revoke privileged from PostgreSQL's superuser
Next
From: raf
Date:
Subject: Re: How to revoke privileged from PostgreSQL's superuser