Efficiency of LIMIT ?

Started by Chris Bitmeadover 26 years ago4 messages
#1Chris Bitmead
chris.bitmead@bigfoot.com

Is the LIMIT feature very efficient? I want to start using it for quite
a few things, but I'm wondering, what happens when I have a zillion
records and I want the first 10, is that going to be an efficient thing
to do?

--
Chris Bitmead
http://www.bigfoot.com/~chris.bitmead
mailto:chris.bitmead@bigfoot.com

#2Adam Haberlach
haberlaa@ricochet.net
In reply to: Chris Bitmead (#1)
Re: [HACKERS] Efficiency of LIMIT ?

On Sun, Apr 25, 1999 at 08:16:58AM +0000, Chris Bitmead wrote:

Is the LIMIT feature very efficient? I want to start using it for quite
a few things, but I'm wondering, what happens when I have a zillion
records and I want the first 10, is that going to be an efficient thing
to do?

I am curious about this myself. As far as I can tell, it doesn't
give anything that cursors don't provide, but introduces more "features"
into the parser. Do we need this?

#3Bruce Momjian
maillist@candle.pha.pa.us
In reply to: Adam Haberlach (#2)
Re: [HACKERS] Efficiency of LIMIT ?

On Sun, Apr 25, 1999 at 08:16:58AM +0000, Chris Bitmead wrote:

Is the LIMIT feature very efficient? I want to start using it for quite
a few things, but I'm wondering, what happens when I have a zillion
records and I want the first 10, is that going to be an efficient thing
to do?

I am curious about this myself. As far as I can tell, it doesn't
give anything that cursors don't provide, but introduces more "features"
into the parser. Do we need this?

This is pretty correct, though it stops the executor from completing all
the result queries, while cursors don't. The complete the entire query
and store the result for later fetches.. We support it because MySQL
users and others asked for it.

-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  maillist@candle.pha.pa.us            |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026
#4Noname
les@MCS.COM
In reply to: Bruce Momjian (#3)
Re: [HACKERS] Efficiency of LIMIT ?

In article <199904251941.PAA00652@candle.pha.pa.us>,
Bruce Momjian <maillist@candle.pha.pa.us> wrote:

Is the LIMIT feature very efficient? I want to start using it for quite
a few things, but I'm wondering, what happens when I have a zillion
records and I want the first 10, is that going to be an efficient thing
to do?

I am curious about this myself. As far as I can tell, it doesn't
give anything that cursors don't provide, but introduces more "features"
into the parser. Do we need this?

This is pretty correct, though it stops the executor from completing all
the result queries, while cursors don't. The complete the entire query
and store the result for later fetches.. We support it because MySQL
users and others asked for it.

It is a nice touch for web interfaces that are going to display
so many records for a request and not maintain any state between
requests.

Les Mikesell
les@mcs.com