Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id D66CF476B5B for ; Wed, 19 Jun 2002 16:38:42 -0400 (EDT) Received: from candle.pha.pa.us (216-55-132-35.dsl.san-diego.abac.net [216.55.132.35]) by postgresql.org (Postfix) with ESMTP id 786DB475A15 for ; Wed, 19 Jun 2002 16:34:56 -0400 (EDT) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.10.1) id g5JKYn616099; Wed, 19 Jun 2002 16:34:49 -0400 (EDT) From: Bruce Momjian Message-Id: <200206192034.g5JKYn616099@candle.pha.pa.us> Subject: Re: Which one is faster? In-Reply-To: <1024514821.20296.5.camel@Monet> To: Wei Weng Date: Wed, 19 Jun 2002 16:34:49 -0400 (EDT) Cc: pgsql-sql@postgresql.org X-Mailer: ELM [version 2.4ME+ PL97 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Archive-Number: 200206/256 X-Sequence-Number: 8221 Wei Weng wrote: > Between Using Limit P, S or using a cursor to start from FETCH ABSOLUTE > S and FETCH NEXT for P times, which one is faster? LIMIT is faster because it doesn't need to generate all the result, in some cases. -- Bruce Momjian | http://candle.pha.pa.us pgman@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