Search Postgresql Archives

Re: Cursors or Offset, Limit?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Nov 15, 2005 at 01:44:32PM -0500, Jerry LeVan wrote:
> 
> What are some of the tradeoffs between using a cursor and using the
> limit/offset method of selecting rows to display?

OFFSET actually has to scan all the preceding rows every time (plus
to get it consistently, you need to do an ORDER BY), so it's fast at
first but possibly painfully slow in the last rows (especially on a
large table).

A

-- 
Andrew Sullivan  | ajs@xxxxxxxxxxxxxxx
A certain description of men are for getting out of debt, yet are
against all taxes for raising money to pay it off.
		--Alexander Hamilton

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

               http://archives.postgresql.org

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux