Received: from candle.pha.pa.us (maillist@s5-03.ppp.op.net [209.152.195.67]) by hub.org (8.8.8/8.8.8) with ESMTP id RAA27926 for ; Tue, 13 Oct 1998 17:05:58 -0400 (EDT) (envelope-from maillist@candle.pha.pa.us) Received: (from maillist@localhost) by candle.pha.pa.us (8.9.0/8.9.0) id RAA10598; Tue, 13 Oct 1998 17:05:43 -0400 (EDT) From: Bruce Momjian Message-Id: <199810132105.RAA10598@candle.pha.pa.us> Subject: Re: [HACKERS] What about LIMIT in SELECT ? In-Reply-To: from Terry Mackintosh at "Oct 13, 1998 2:53:22 pm" To: terry@terrym.com Date: Tue, 13 Oct 1998 17:05:43 -0400 (EDT) Cc: hackers@postgreSQL.org X-Mailer: ELM [version 2.4ME+ PL47 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit > Hi, my 2 cents... > > I agree completely, LIMIT would be VERY usefull in web based apps, which > is all I run. It does not matter to me if it is not part of a formal > standard. The idea is so common that it is a defacto standard. > > I would not expect it for this release, but could it get put on the TODO > list for next time? I am even willing to work at an apprentise level on > this with a more expeireanced person that knows this stuff. I assume everyone has read the FAQ item: How do I select only the first few rows of a query? See the fetch manual page.

This only prevents all row results from being transfered to the client. The entire query must be evaluated, even if you only want just the first few rows. Consider a query that has an order by. There is no way to return any rows until the entire query is evaluated and sorted. -- 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