X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 1445B9FA29F for ; Thu, 11 May 2006 03:36:09 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 19291-10 for ; Thu, 11 May 2006 03:36:01 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mailer.eglobalreach.net (mailer.eglobalreach.net [202.124.128.22]) by postgresql.org (Postfix) with ESMTP id A58E09FA15C for ; Thu, 11 May 2006 03:35:59 -0300 (ADT) Received: from ghwk02002147 (mailer.eglobalreach.net [127.0.0.1]) by mailer.eglobalreach.net (8.11.6p2/) with ESMTP id k4B6Zwf30823 for ; Thu, 11 May 2006 14:35:58 +0800 From: "Christian Paul Cosinas" To: Subject: Speed Up Offset and Limit Clause Date: Thu, 11 May 2006 14:45:33 -0000 Message-ID: <002801c67509$8f1a51a0$1e21100a@ghwk02002147> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1807 In-Reply-To: <25818.1147310405@sss.pgh.pa.us> Thread-Index: AcZ0mS/0CCepxqjOT6y1bSuaIABQ5wAb/JNg X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200605/285 X-Sequence-Number: 19072 Hi! How can I speed up my server's performance when I use offset and limit clause. For example I have a query: SELECT * FROM table ORDER BY id, name OFFSET 100000 LIMIT 10000 This query takes a long time about more than 2 minutes. If my query is: SELECT * FROM table ORDER BY id, name OFFSET 50000 LIMIT 10000 It takes about 2 seconds. Thanks