Skip site navigation (1) Skip section navigation (2)

Re: Scrollable cursors and Sort performance

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Scrollable cursors and Sort performance
Date: 2006-02-27 23:20:36
Message-ID: 23202.1141082436@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
"Jim C. Nasby" <jnasby(at)pervasive(dot)com> writes:
> On Mon, Feb 27, 2006 at 06:01:21PM -0500, Tom Lane wrote:
>> There is no EXPLAIN ANALYZE DECLARE, and AFAICS it would be a
>> contradiction in terms to have one, since DECLARE doesn't run the query.

> You have no idea how glad I am that I'm not the only one who doesn't know about
> 'new' features (this first appeared in the docs in 7.4)... :)

> decibel=# explain analyze declare test cursor for select * from pg_users;
>                         QUERY PLAN                        
> ----------------------------------------------------------
>  Seq Scan on pg_authid  (cost=0.00..1.01 rows=1 width=79)
>    Filter: rolcanlogin
> (2 rows)

Please notice that it didn't run the query (no actual-time data).

Perhaps it would be better if the code raised an error instead of
silently ignoring the ANALYZE keyword.  I think this behavior
was chosen on the grounds that since DECLARE doesn't run the query,
it's consistent for EXPLAIN ANALYZE DECLARE to be a no-op as well.
But it's confusing now that I look at it again.  In any case,
one should clearly need to say FETCH to get a cursor to execute.

			regards, tom lane

In response to

pgsql-hackers by date

Next:From: Jim C. NasbyDate: 2006-02-27 23:39:06
Subject: Re: Dead Space Map
Previous:From: Jim C. NasbyDate: 2006-02-27 23:12:05
Subject: Re: Scrollable cursors and Sort performance

pgsql-patches by date

Next:From: Bruce MomjianDate: 2006-02-28 05:45:18
Subject: Re: [HACKERS] how solve diff of API counstruct_md_array between
Previous:From: Jim C. NasbyDate: 2006-02-27 23:12:05
Subject: Re: Scrollable cursors and Sort performance

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group