Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 25C9F159078 for ; Mon, 5 Mar 2012 14:50:21 -0400 (AST) Received: from mail-vw0-f46.google.com ([209.85.212.46]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1S4czE-0006rr-C9 for pgsql-hackers@postgresql.org; Mon, 05 Mar 2012 18:50:21 +0000 Received: by vbbff1 with SMTP id ff1so3707051vbb.19 for ; Mon, 05 Mar 2012 10:50:07 -0800 (PST) Received-SPF: pass (google.com: domain of noah@leadboat.com designates 10.52.180.98 as permitted sender) client-ip=10.52.180.98; Authentication-Results: mr.google.com; spf=pass (google.com: domain of noah@leadboat.com designates 10.52.180.98 as permitted sender) smtp.mail=noah@leadboat.com Received: from mr.google.com ([10.52.180.98]) by 10.52.180.98 with SMTP id dn2mr37216279vdc.61.1330973407431 (num_hops = 1); Mon, 05 Mar 2012 10:50:07 -0800 (PST) Received: by 10.52.180.98 with SMTP id dn2mr31884409vdc.61.1330973407317; Mon, 05 Mar 2012 10:50:07 -0800 (PST) Received: from tornado.leadboat.com (ip68-230-222-48.rd.hr.cox.net. [68.230.222.48]) by mx.google.com with ESMTPS id r5sm14477189vdg.17.2012.03.05.10.50.05 (version=SSLv3 cipher=OTHER); Mon, 05 Mar 2012 10:50:06 -0800 (PST) Date: Mon, 5 Mar 2012 13:50:04 -0500 From: Noah Misch To: Michael Meskes Cc: Boszormenyi Zoltan , PG Hackers , Robert Haas , Heikki Linnakangas , Bruce Momjian Subject: Re: ECPG FETCH readahead Message-ID: <20120305185004.GD13348@tornado.leadboat.com> References: <201006232042.o5NKgb503695@momjian.us> <4C2308FD.1090300@cybertec.at> <4C231F9E.6000102@enterprisedb.com> <20100624121922.GD24137@feivel.credativ.lan> <4CB6D3C8.3020709@cybertec.at> <4EC41434.7010603@cybertec.at> <4EFC36EF.1060308@cybertec.at> <20120302164105.GD23100@tornado.leadboat.com> <20120304161606.GA4706@feivel.credativ.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120304161606.GA4706@feivel.credativ.lan> User-Agent: Mutt/1.5.18 (2008-05-17) X-Gm-Message-State: ALoCoQlWDzrlAiswiPcMMoIYz2L+ejvOuID/ASA0FN37wSTSXpAH3pppJUUqwnilbc0xchRKjG7D X-Pg-Spam-Score: -2.6 (--) X-Archive-Number: 201203/220 X-Sequence-Number: 204102 On Sun, Mar 04, 2012 at 05:16:06PM +0100, Michael Meskes wrote: > On Fri, Mar 02, 2012 at 11:41:05AM -0500, Noah Misch wrote: > > I suggest enabling the feature by default but drastically reducing the default > > readahead chunk size from 256 to, say, 5. That still reduces the FETCH round > > trip overhead by 80%, but it's small enough not to attract pathological > > behavior on a workload where each row is a 10 MiB document. I would not offer > > an ecpg-time option to disable the feature per se. Instead, let the user set > > the default chunk size at ecpg time. A setting of 1 effectively disables the > > feature, though one could later re-enable it with ECPGFETCHSZ. > > Using 1 to effectively disable the feature is fine with me, but I strongly > object any default enabling this feature. It's farily easy to create cases with > pathological behaviour and this features is not standard by any means. I figure > a normal programmer would expect only one row being transfered when fetching > one. On further reflection, I agree with you here. The prospect for queries that call volatile functions changed my mind; they would exhibit different functional behavior under readahead. We mustn't silently give affected programs different semantics. Thanks, nm