pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Re: execute cursor fetch
5+ messages / 5 participants
[nested] [flat]

* Re: execute cursor fetch
@ 2004-10-12 11:43  my ho <mthoatbanjo@yahoo.com>
  0 siblings, 2 replies; 5+ messages in thread

From: my ho @ 2004-10-12 11:43 UTC (permalink / raw)
  To: pgsql-performance

Hi, 
If anyone can help pls, I have a question abt the
execution of cursor create/fetch/move , in particular
about disk cost. When a cursor is created, is the
whole table (with the required columns) got put into
memory? otherwise how does it work? (in term of disk
read and transfer?) after user issues command
move/fetch, how does postgre speed up the query in
compare to normal selection?
Thanks a lot, 
regards,
MT Ho 



		
__________________________________
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.
http://promotions.yahoo.com/new_mail 



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: execute cursor fetch
@ 2004-10-12 12:36  Pierre-Frédéric Caillaud <lists@boutiquenumerique.com>
  parent: my ho <mthoatbanjo@yahoo.com>
  1 sibling, 1 reply; 5+ messages in thread

From: Pierre-Frédéric Caillaud @ 2004-10-12 12:36 UTC (permalink / raw)
  To: my ho <mthoatbanjo@yahoo.com>; pgsql-performance


	I just discovered this :

http://www.postgresql.org/docs/7.4/static/jdbc-query.html#AEN24298


On Tue, 12 Oct 2004 04:43:43 -0700 (PDT), my ho <mthoatbanjo@yahoo.com>  
wrote:

> Hi,
> If anyone can help pls, I have a question abt the
> execution of cursor create/fetch/move , in particular
> about disk cost. When a cursor is created, is the
> whole table (with the required columns) got put into
> memory? otherwise how does it work? (in term of disk
> read and transfer?) after user issues command
> move/fetch, how does postgre speed up the query in
> compare to normal selection?
> Thanks a lot,
> regards,
> MT Ho
>
>
>
> 		
> __________________________________
> Do you Yahoo!?
> Yahoo! Mail Address AutoComplete - You start. We finish.
> http://promotions.yahoo.com/new_mail
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>





^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: execute cursor fetch
@ 2004-10-12 13:05  Stef <svb@ucs.co.za>
  parent: Pierre-Frédéric Caillaud <lists@boutiquenumerique.com>
  0 siblings, 1 reply; 5+ messages in thread

From: Stef @ 2004-10-12 13:05 UTC (permalink / raw)
  To: pgsql-performance

Pierre-Frédéric Caillaud mentioned :
=> http://www.postgresql.org/docs/7.4/static/jdbc-query.html#AEN24298

My question is :
Is this only true for postgres versions >= 7.4 ?

I see the same section about "Setting fetch size to turn cursors on and off"
is not in the postgres 7.3.7 docs. Does this mean 7.3 the JDBC driver
for postgres < 7.4 doesn't support this ?

Kind Regards
Stefan



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: execute cursor fetch
@ 2004-10-12 14:07  Tom Lane <tgl@sss.pgh.pa.us>
  parent: my ho <mthoatbanjo@yahoo.com>
  1 sibling, 0 replies; 5+ messages in thread

From: Tom Lane @ 2004-10-12 14:07 UTC (permalink / raw)
  To: my ho <mthoatbanjo@yahoo.com>; +Cc: pgsql-performance

my ho <mthoatbanjo@yahoo.com> writes:
> If anyone can help pls, I have a question abt the
> execution of cursor create/fetch/move , in particular
> about disk cost. When a cursor is created, is the
> whole table (with the required columns) got put into
> memory?

No.  The plan is set up and then incrementally executed each time you
say FETCH.

> how does postgre speed up the query in
> compare to normal selection?

The only difference from a SELECT is that the planner will prefer
"fast-start" plans, on the theory that you may not be intending
to retrieve the whole result.  For instance it might prefer an
indexscan to a seqscan + sort, when it otherwise wouldn't.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: execute cursor fetch
@ 2004-10-15 22:30  Kris Jurka <books@ejurka.com>
  parent: Stef <svb@ucs.co.za>
  0 siblings, 0 replies; 5+ messages in thread

From: Kris Jurka @ 2004-10-15 22:30 UTC (permalink / raw)
  To: Stef <svb@ucs.co.za>; +Cc: pgsql-performance



On Tue, 12 Oct 2004, Stef wrote:

> Pierre-Frédéric Caillaud mentioned :
> => http://www.postgresql.org/docs/7.4/static/jdbc-query.html#AEN24298
> 
> My question is :
> Is this only true for postgres versions >= 7.4 ?
> 
> I see the same section about "Setting fetch size to turn cursors on and off"
> is not in the postgres 7.3.7 docs. Does this mean 7.3 the JDBC driver
> for postgres < 7.4 doesn't support this ?
> 

You need the 7.4 JDBC driver, but can run it against a 7.3 (or 7.2) 
database.  Also note the 8.0 JDBC driver can only do this against a 7.4 or 
8.0 database and not older versions.

Kris Jurka



^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2004-10-15 22:30 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-10-12 11:43 Re: execute cursor fetch my ho <mthoatbanjo@yahoo.com>
2004-10-12 12:36 ` Pierre-Frédéric Caillaud <lists@boutiquenumerique.com>
2004-10-12 13:05   ` Stef <svb@ucs.co.za>
2004-10-15 22:30     ` Kris Jurka <books@ejurka.com>
2004-10-12 14:07 ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox