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 A0FAC9FA2D8 for ; Sat, 27 May 2006 18:02:26 -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 43194-05 for ; Sat, 27 May 2006 18:02:21 -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 406BD9FA176 for ; Sat, 27 May 2006 18:02:20 -0300 (ADT) Received: (qmail 29479 invoked from network); 27 May 2006 23:04:52 +0200 Received: from boutiquenumerique.com (HELO apollo13) (82.67.9.10) by boutiquenumerique.com with SMTP; 27 May 2006 23:04:52 +0200 Date: Sat, 27 May 2006 23:04:51 +0200 From: PFC To: "Christian Paul Cosinas" , pgsql-performance@postgresql.org Subject: Re: Speed Up Offset and Limit Clause References: <00e101c67997$6aa049f0$1e21100a@ghwk02002147> Message-ID: In-Reply-To: <00e101c67997$6aa049f0$1e21100a@ghwk02002147> User-Agent: Opera M2/8.54 (Linux, build 1745) Content-Type: text/plain; format=flowed; delsp=yes; charset=utf-8 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200605/500 X-Sequence-Number: 19287 > Thread 1 : gets offset 0 limit 5000 > Thread 2 : gets offset 5000 limit 5000 > Thread 3 : gets offset 10000 limit 5000 > > Would there be any other faster way than what It thought? Yeah, sure, use a thread which does the whole query (maybe using a cursor) and fills a queue with the results, then N threads consuming from that queue... it will work better.