Re: [HACKERS] What about LIMIT in SELECT ?

From: "Marc G(dot) Fournier" <scrappy(at)hub(dot)org>
To: Eric Lee Green <eric(at)linux-hw(dot)com>
Cc: Jeff Hoffmann <jeff(at)remapcorp(dot)com>, PostgreSQL-development <hackers(at)postgreSQL(dot)org>
Subject: Re: [HACKERS] What about LIMIT in SELECT ?
Date: 1998-10-13 22:48:35
Message-ID: Pine.BSF.4.05.9810131844171.4514-100000@hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs pgsql-hackers

On Tue, 13 Oct 1998, Eric Lee Green wrote:

> Whoops! Sorry, I goofed in my post (typing faster than my brain :-).
> What I *MEANT* to say was that this superiority of cursors was not
> applicable in a web environment.

S'alright...now please backup your statement with the *why*...

> > but wha is the different between using LIMIT to get X records, and
> > definiing a cursor to FETCH X records?
>
> >From a logical point of view, none. From an implementation point of
> view, it is a matter of speed. Declaring a cursor four times, doing a
> query four times, and fetching X records four times takes more time
> than just doing a query with a LIMIT clause four times (assuming your
> query results in four screenfulls of records).

I'm going to be brain-dead here, since, as I've disclaimered
before, I've not used CURSORs/FETCHs as of yet...one person came back
already and stated that, for him, CURSOR/FETCH results were near
instantaneous with a 167k+ table...have you tested the two to ensure that,
in fact, one is/isn't faster then the other?

Marc G. Fournier scrappy(at)hub(dot)org
Systems Administrator @ hub.org
scrappy(at){postgresql|isc}.org ICQ#7615664

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Eric Lee Green 1998-10-13 22:55:22 Re: [HACKERS] What about LIMIT in SELECT ?
Previous Message Eric Lee Green 1998-10-13 22:39:01 Re: [HACKERS] What about LIMIT in SELECT ?

Browse pgsql-hackers by date

  From Date Subject
Next Message Marc G. Fournier 1998-10-13 22:50:05 PostgreSQL v6.4 BETA2 ...
Previous Message Eric Lee Green 1998-10-13 22:39:01 Re: [HACKERS] What about LIMIT in SELECT ?