X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 6117E11F6D19 for ; Thu, 20 Apr 2006 13:05:18 -0300 (ADT) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Score: 0.09 X-Spam-Level: X-Spam-Status: No, score=0.09 required=5 tests=[AWL=0.090] Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id C6hsgPCtmbBt for ; Thu, 20 Apr 2006 13:05:05 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from nz-out-0102.google.com (nz-out-0102.google.com [64.233.162.205]) by postgresql.org (Postfix) with ESMTP id C8B0E11F6997 for ; Thu, 20 Apr 2006 13:05:05 -0300 (ADT) Received: by nz-out-0102.google.com with SMTP id z3so177772nzf for ; Thu, 20 Apr 2006 09:05:02 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=h5EvT+PBxkmrdQGBcCuRHAOZAlWoC31ZgCPceDJBRdTctuqcP0dH1kxqKu/z4L4LGrjhQ0SqdJtTx8yGO5fHVY4StUSaIzdcsY2zEbkuFuwBYYvmrxahVW8NHjZnWMSiVEIMXqTcc8RnnOTEx2zt2BZTj1MRBjSP2N9q+WJ82i8= Received: by 10.65.124.5 with SMTP id b5mr439968qbn; Thu, 20 Apr 2006 09:05:02 -0700 (PDT) Received: by 10.65.137.8 with HTTP; Thu, 20 Apr 2006 09:05:02 -0700 (PDT) Message-ID: Date: Thu, 20 Apr 2006 12:05:02 -0400 From: "Merlin Moncure" To: "soni de" Subject: Re: Takes too long to fetch the data from database Cc: pgsql-performance@postgresql.org In-Reply-To: <9f2e40a90604192237i5d3e8f0dl1c8b19887bc34e22@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <9f2e40a90604100021n1cb694d0lb95f318f800f33ee@mail.gmail.com> <9f2e40a90604110004u787716c2s22bdf53fe349326@mail.gmail.com> <9f2e40a90604192237i5d3e8f0dl1c8b19887bc34e22@mail.gmail.com> X-Archive-Number: 200604/458 X-Sequence-Number: 18542 > SELECT * FROM wan ORDER BY stime LIMIT 50 OFFSET 81900; you need to try and solve the problem without using 'offset'. you could do= : BEGIN; DECLARE crs cursor FOR SELECT * FROM wan ORDER BY stime; FETCH ABSOLUTE 81900 in crs; FETCH 49 in crs; CLOSE crs; COMMIT; this may be a bit faster but will not solve the fundamental problem. the more interesting question is why you want to query exactly 81900 rows into a set. This type of thinking will always get you into trouble, absolute positioning will not really work in a true sql sense. if you are browsing a table sequentially, there are much better methods. merlin