X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id D801752816 for ; Fri, 24 Jun 2005 15:55:01 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 08961-06 for ; Fri, 24 Jun 2005 18:54:58 +0000 (GMT) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.198]) by svr1.postgresql.org (Postfix) with ESMTP id 701C252932 for ; Fri, 24 Jun 2005 15:54:54 -0300 (ADT) Received: by wproxy.gmail.com with SMTP id 69so1089811wra for ; Fri, 24 Jun 2005 11:54:55 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=m8SNoth2egk4w3n2hdUrOOpJnsg64KyQYtHAlbTprRcSKJDyRsb9LVNSMa2FThtRQmBw15rgCOSiJPd9CGeTU2BQUQvxvG3Feax9RBG74vBkSKRZC6F2GVKLucUedv2nX4Th7+F5WyDMcnbVOxismto5PRHct3/XJNysGNTqc0c= Received: by 10.54.101.10 with SMTP id y10mr2023274wrb; Fri, 24 Jun 2005 11:54:55 -0700 (PDT) Received: by 10.54.13.24 with HTTP; Fri, 24 Jun 2005 11:54:55 -0700 (PDT) Message-ID: <9e4684ce05062411545fdfe5fc@mail.gmail.com> Date: Fri, 24 Jun 2005 20:54:55 +0200 From: hubert depesz lubaczewski Reply-To: hubert depesz lubaczewski To: Yves Vindevogel Subject: Re: Speed with offset clause Cc: pgsql-performance@postgresql.org In-Reply-To: <1c365a8bdeb09957fadda7a6fdc8ff02@implements.be> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <1c365a8bdeb09957fadda7a6fdc8ff02@implements.be> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.056 tagged_above=0 required=5 tests=AWL, RCVD_BY_IP X-Spam-Level: X-Archive-Number: 200506/474 X-Sequence-Number: 13111 On 6/24/05, Yves Vindevogel wrote: > So, when I want the last page, which is: 600k / 25 =3D page 24000 - 1 =3D > 23999, I issue the offset of 23999 * 25 improving this is hard, but not impossible. if you have right index created, try to reverse the order and fetch first adverts, and then resort it (just the 25 adverts) in correct order. it will be faster. depesz