Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id D13502BE258; Mon, 16 Apr 2012 01:27:16 -0300 (ADT) Received: from [87.118.86.135] (helo=km31432.keymachine.de) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SJdX1-0003dA-8q; Mon, 16 Apr 2012 04:27:16 +0000 Received: from localhost.localdomain (unknown [87.242.62.156]) by km31432.keymachine.de (Postfix) with ESMTPSA id 057913900157; Mon, 16 Apr 2012 04:32:36 +0000 (UTC) Message-ID: <4F8B9F19.3040403@cybertec.at> Date: Mon, 16 Apr 2012 06:24:57 +0200 From: Boszormenyi Zoltan User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120329 Thunderbird/11.0.1 MIME-Version: 1.0 To: Noah Misch , Michael Meskes , Robert Haas , PG Hackers , Heikki Linnakangas , Bruce Momjian Subject: Re: ECPG FETCH readahead References: <4F74E6A7.8040204@cybertec.at> <20120407112008.GA2286@feivel.credativ.lan> <20120407155042.GB11987@tornado.leadboat.com> <20120408142501.GA21513@feivel.credativ.lan> <4F81BE55.1010904@cybertec.at> <20120408173859.GA4915@feivel.credativ.lan> <4F83E2B9.3030302@cybertec.at> <20120410143722.GC6129@tornado.leadboat.com> <20120410145501.GA11554@feivel.credativ.lan> <4F847453.9060200@cybertec.at> <20120416024636.GA4536@feivel.credativ.lan> In-Reply-To: <20120416024636.GA4536@feivel.credativ.lan> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 87.118.86.135 (deferred) X-Pg-Spam-Score: -1.1 (-) X-Archive-Number: 201204/797 X-Sequence-Number: 206600 2012-04-16 04:46 keltez=C3=A9ssel, Michael Meskes =C3=ADrta: > On Tue, Apr 10, 2012 at 07:56:35PM +0200, Boszormenyi Zoltan wrote: >> With the above, it would be possible to use a comma separated list of = "-r" >> suboptions, e.g. "-r prepare,questionmarks,readahead=3D16" in one opti= on. > Yes, that sounds like a good plan. But of course it's outside the scope= of this > patch, so we can add this later on. > >> - Also added a note to the documentation about a possible performance = trap >> if a previously written ECPG application uses its own custom readah= ead via >> multi-row FETCH statements. > I didn't know that before you send this patch. Noah, did you? > > Frankly, I don't like this at all. If I got it right that means a FETCH= N is > essantially computed as N times FETCH 1 unless you either add a non-sta= ndard > option to the DECLARE statement or you add a command-line option to ecp= g. Did I > get that right? Yes, just like when the readahead window set to 256, FETCH 1024 will iterate through 4 windows or FETCH 64 iterates through the same window 4 times. This is the idea behind the "readahead window". > If so we would deliberately make ecpglib work incorrectly and remove > performance. Why is that? I'm interested in what others think, but to m= e that > sounds like a show-stopper. How about allowing the readahead window to be resized for the non-decorated case if the runtime encounters FETCH N and N is greater than the previous window? > > Michael > --=20 ---------------------------------- Zolt=C3=A1n B=C3=B6sz=C3=B6rm=C3=A9nyi Cybertec Sch=C3=B6nig& Sch=C3=B6nig GmbH Gr=C3=B6hrm=C3=BChlgasse 26 A-2700 Wiener Neustadt, Austria Web: http://www.postgresql-support.de http://www.postgresql.at/