Re: [HACKERS] What about LIMIT in SELECT ? - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: [HACKERS] What about LIMIT in SELECT ?
Date
Msg-id 199810132118.RAA11266@candle.pha.pa.us
Whole thread Raw
In response to Re: [HACKERS] What about LIMIT in SELECT ?  ("Marc G. Fournier" <scrappy@hub.org>)
Responses Re: [HACKERS] What about LIMIT in SELECT ?  ("Matthew N. Dodd" <winter@jurai.net>)
Re: [HACKERS] What about LIMIT in SELECT ?  (Terry Mackintosh <terry@terrym.com>)
List pgsql-hackers
> Ookay, I'm sorry, butyou lost me here.  I haven't gotten into using
> CURSORs/FETCHs yet, since I haven't need it...but can you give an example
> of what you would want to do using a LIMIT?  I may be missing something,
> but wha is the different between using LIMIT to get X records, and
> definiing a cursor to FETCH X records?
>
> Practical example of *at least* the LIMIT side would be good, so that we
> can at least see a physical example of what LIMIT can do that
> CURSORs/FETCH can't...

My guess in a web application is that the transaction is started for
every new page, so you can't have transactions spanning SQL sessions.

LIMIT theoretically would allow you to start up where you left off.

--
  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


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] What about LIMIT in SELECT ?
Next
From: "Marc G. Fournier"
Date:
Subject: Re: [ADMIN] COPY slows down; is it normal?