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 60ECC9FA29F for ; Thu, 11 May 2006 04:04:45 -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 49395-05 for ; Thu, 11 May 2006 04:04:41 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from peufeu.com (boutiquenumerique.com [82.67.9.10]) by postgresql.org (Postfix) with ESMTP id 99E879FACFE for ; Thu, 11 May 2006 04:04:32 -0300 (ADT) Received: (qmail 7147 invoked from network); 11 May 2006 09:05:58 +0200 Received: from boutiquenumerique.com (HELO apollo13) (82.67.9.10) by boutiquenumerique.com with SMTP; 11 May 2006 09:05:58 +0200 To: "Christian Paul Cosinas" , pgsql-performance@postgresql.org Subject: Re: Speed Up Offset and Limit Clause References: <002801c67509$8f1a51a0$1e21100a@ghwk02002147> Message-ID: From: PFC Content-Type: text/plain; format=flowed; delsp=yes; charset=utf-8 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Date: Thu, 11 May 2006 09:05:56 +0200 In-Reply-To: <002801c67509$8f1a51a0$1e21100a@ghwk02002147> User-Agent: Opera M2/8.51 (Linux, build 1462) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200605/287 X-Sequence-Number: 19074 Why do you want to use it this way ? Explain what you want to do, there probably is another faster solution... On Thu, 11 May 2006 16:45:33 +0200, Christian Paul Cosinas wrote: > 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 > > > ---------------------------(end of broadcast)--------------------------- > TIP 9: In versions below 8.0, the planner will ignore your desire to > choose an index scan if your joining column's datatypes do not > match