Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 78E156355C4 for ; Fri, 3 Jul 2009 11:38:19 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 69269-03-5 for ; Fri, 3 Jul 2009 11:38:08 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-vw0-f173.google.com (mail-vw0-f173.google.com [209.85.212.173]) by mail.postgresql.org (Postfix) with ESMTP id 309226352C0 for ; Fri, 3 Jul 2009 11:38:13 -0300 (ADT) Received: by vwj3 with SMTP id 3so1363573vwj.15 for ; Fri, 03 Jul 2009 07:38:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=LIXe96p8VPFNl3lQ83zR4kJi5P/+7QhrQvceEjrR/vY=; b=YiFvxARdRtIbvWTo5a5a4wN5irpvJ9efcfJb1aDKtmRBtAGx9E0AO+6bbELiktV9u9 JC6vPKAO2RRkyh0JKmwx3vZ3PycvlzEKJ5WJ6781LFsTcrpFKjeHpzH6VDHhGHADoQX6 tQfFd0ewgA4BmCBnKQeuyjN/bT3n7GyhztNUs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=Dr5sCIXHOg4IRp4pFnc+MBDgogRqgEyqvKVuOOJJpnjiSfzwMbAF+6+yYldKAxI4GK bUwJaA6FUMgUrUY+Qr8BUwROe8YOsw3rNpJHjgXZa4d+70jwLL/CUequAl7Lak6nR13t PwJIMarGsQJruaqRA61CHr+Qs4/AEEDOfWd4E= MIME-Version: 1.0 Received: by 10.220.91.133 with SMTP id n5mr2746303vcm.102.1246631891751; Fri, 03 Jul 2009 07:38:11 -0700 (PDT) In-Reply-To: <749.1246631075@sss.pgh.pa.us> References: <1b795e7b0907030546o7e44ebcdteb1168c9d6680380@mail.gmail.com> <1b795e7b0907030601x53ad69efk5412acc1a2595c61@mail.gmail.com> <4A4E04D1.5010905@opencloud.com> <1b795e7b0907030639r562a9006g4c3b286bce3e5d7b@mail.gmail.com> <4A4E11EB.4040809@opencloud.com> <749.1246631075@sss.pgh.pa.us> Date: Fri, 3 Jul 2009 15:38:11 +0100 Message-ID: <1b795e7b0907030738v67964f36ic4bbbf39ace0e5af@mail.gmail.com> Subject: Re: Cursor-based results: bafflingly slow From: Robin Houston To: Tom Lane Cc: pgsql-jdbc@postgresql.org Content-Type: multipart/alternative; boundary=0016e647622a12d506046dce1b80 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200907/9 X-Sequence-Number: 19777 --0016e647622a12d506046dce1b80 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 2009/7/3 Tom Lane > You need to use a cursor for that. The problem with the fetchsize > mechanism is that it doesn't give the planner any clue that the user > might not intend to fetch the whole result, or might prefer low startup > cost to low total cost anyway. Thank you very much (and Oliver too). That's what I needed to know. I'll change my code to use explicit cursors. Robin --0016e647622a12d506046dce1b80 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
2009/7/3 Tom Lane <tgl@sss.pgh.pa.us>
You need to use a cursor for that. =A0The problem with th= e fetchsize
mechanism is that it doesn't give the planner any clue that the user might not intend to fetch the whole result, or might prefer low startup
cost to low total cost anyway.

Thank you ve= ry much (and Oliver too). That's what I needed to know. I'll change= my code to use explicit cursors.

Robin
--0016e647622a12d506046dce1b80--