Re: Scrollable cursors and Sort performance

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Scrollable cursors and Sort performance
Date: 2006-02-10 18:14:12
Message-ID: 20060210181412.GD576@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

On Fri, Feb 10, 2006 at 04:48:42PM +0000, Simon Riggs wrote:
> If a cursor is defined NO SCROLL, which is the SQL Standard implicit
> default, then we are safe to assume there will be no rewinds or backward
> scans. The PostgreSQL current implicit default is SCROLL, which means
> that no part of the executor can currently make useful assumptions about
> scan direction, so this is a wider issue than just sorts.

Umm, the documentation says: PostgreSQL will allow backward fetches
without SCROLL, if the cursor's query plan is simple enough that no
extra overhead is needed to support it.

So if the default is SCROLL someone needs to fix the docs because
that's not what it says. It says that *some plans* can be fetched
backwards even if you don't say scroll. The documentation clearly says
we don't need to support backwards searches without scroll if it
causes problems.

Have a nice day,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2006-02-10 19:04:29 Re: Scrollable cursors and Sort performance
Previous Message Greg Stark 2006-02-10 18:05:26 Re: PostgreSQL 8.0.6 crash

Browse pgsql-patches by date

  From Date Subject
Next Message Martijn van Oosterhout 2006-02-10 18:43:49 Re: [COMMITTERS] pgsql: Allow psql multi-line column values to align
Previous Message Simon Riggs 2006-02-10 17:46:27 Re: Scrollable cursors and Sort performance