Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UDIEg-00059N-4Q for pgsql-bugs@arkaria.postgresql.org; Wed, 06 Mar 2013 17:34:38 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1UDIEf-0004r7-Fr for pgsql-bugs@arkaria.postgresql.org; Wed, 06 Mar 2013 17:34:37 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UDIEe-0004r1-DL for pgsql-bugs@postgresql.org; Wed, 06 Mar 2013 17:34:36 +0000 Received: from nm5.bullet.mail.bf1.yahoo.com ([98.139.212.164]) by magus.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1UDIEa-0000Ep-2p for pgsql-bugs@postgresql.org; Wed, 06 Mar 2013 17:34:35 +0000 Received: from [98.139.212.152] by nm5.bullet.mail.bf1.yahoo.com with NNFMP; 06 Mar 2013 17:34:29 -0000 Received: from [98.139.212.198] by tm9.bullet.mail.bf1.yahoo.com with NNFMP; 06 Mar 2013 17:34:29 -0000 Received: from [127.0.0.1] by omp1007.mail.bf1.yahoo.com with NNFMP; 06 Mar 2013 17:34:29 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 868762.56654.bm@omp1007.mail.bf1.yahoo.com Received: (qmail 94674 invoked by uid 60001); 6 Mar 2013 17:34:29 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ymail.com; s=s1024; t=1362591269; bh=0aYA3O+HWVuLRp3l7lxsA47Be/FdbX5UGui25yfNwNQ=; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=TsVGXYPXjkCA8Dg0Nrjg/f6uflE+0jkl5utTRc0C5YpMVo0kVjBDj6MYJn9s2fqqzO6MhO+AI8vV0T3g+lPR3oAn+eG4eQD6FKQG+dLO6OaACtqm9PeTsFPEPItI1g7GphQUDLz3Ba4aW9gkhACkmLD8UZv0dVFVZTsN1S88oZs= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=ymail.com; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=05ArnCwacGADsmfBSwJVl5ZQe8eo//GpzyM3lYgLDObSSg4VT6AK4pY0rjFwKE52xGKh9908cAOyU6uCjbqgPUb7ESPcqod2GDS4zWqnx1wlIIxGVQFBxVwRPIsouCHtDiEXK0C5/aUfVRmJnjPW1Ny2snS6814hO5qOSk7vSqA=; X-YMail-OSG: _D7hBWoVM1mM4FRJcYGyzZAEBA7kv5K3K4P.Z_5oQw_F32h 0j5XV8D3OByTIAMY4a6Mgt3yzgAsxSv0wixxckwHZ2jfhuMNLUwz0rcphhxC bNx7LYI8pQBxlqAm2wzurPBRJ4H7A4NJBFGYQ07XkldUe_nlCsFprCZZ1y.m J6XEAAkCJMrMWmGJ1awQTyksgv1iHijQn_BnbwLwFcNZM0rFEizM7GfZP7Zm 6UNAsGSn88VCFkc28m0JuOqFQhFV0tkqIGp1DzZEWQNW0CbH3n_xZMmdhuh6 KX0S.fUPOt_o3Q9fyh8R06qT2ELxH...OnkVflzd1hn.1zkipHk0zaTFQWM7 QyvvfG0o4iCQOmFrolCww0qVy1M7wsysGUCqVwy..u42.1y_46vWivSdJe8u CJdXbZ.3UbiNxPzH_erpj.ZQopZeretEwx_M3UxDxKM_iwlj5C6_6s3X5_.C SismisXb.HNzMmVw0YffPvhF.Y_t3Z86kPo_bRtEoFYH2tXvYK_1wd4xGEGM ng4c4grfEMKHMr_QsZn_DhsVr5ICNE7c4tW63T04- Received: from [76.255.18.237] by web162903.mail.bf1.yahoo.com via HTTP; Wed, 06 Mar 2013 09:34:29 PST X-Rocket-MIMEInfo: 001.001, ImFkcmlhbm9wYXRyaWNrQGdtYWlsLmNvbSIgPGFkcmlhbm9wYXRyaWNrQGdtYWlsLmNvbT4gd3JvdGU6Cgo.IEkgbmVlZCB0byBwcm9jZXNzIGEgcXVlcnksIHRoZSBxdWVyeSByZXR1cm5lZCBhcyBzb21ld2hlcmUgYXJvdW5kCj4gMjAgbWlsbGlvbiByZWNvcmRzLCBJIHRob3VnaHQgdG8gZG8gd2l0aCBMSU1JVCBhbmQgT0ZGU0VUIHdoZXJlCj4gdGhlIGxpbWl0IGlzIGZpeGVkIGZvciA1MDAwIHJlY29yZHMgYW5kIHdpbGwgaW5jcmVtZW50aW5nIHRoZQo.IE9GRlNFVCwgYnV0IHdoZW4gcmVhY2hlZCBPRkYBMAEBAQE- X-Mailer: YahooMailWebService/0.8.135.514 References: Message-ID: <1362591269.94284.YahooMailNeo@web162903.mail.bf1.yahoo.com> Date: Wed, 6 Mar 2013 09:34:29 -0800 (PST) From: Kevin Grittner Reply-To: Kevin Grittner Subject: Re: BUG #7918: limitation of pagination with LIMIT and OFFSET To: "adrianopatrick@gmail.com" , "pgsql-bugs@postgresql.org" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Pg-Spam-Score: 1.7 (+) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org "adrianopatrick@gmail.com" wrote: > I need to process a query, the query returned as somewhere around > 20 million records, I thought to do with LIMIT and OFFSET where > the limit is fixed for 5000 records and will incrementing the > OFFSET, but when reached OFFSET 400 000 consultation was very > slow, taking almost the time of the query without LIMIT and > OFFSET. You should probably use a cursor instead of LIMIT and OFFSET. -- Kevin Grittner EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs