Re: ECPG FETCH readahead

From: Boszormenyi Zoltan <zb(at)cybertec(dot)at>
To: Noah Misch <noah(at)leadboat(dot)com>, Michael Meskes <meskes(at)postgresql(dot)org>, Robert Haas <robertmhaas(at)gmail(dot)com>, PG Hackers <pgsql-hackers(at)postgresql(dot)org>, Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>
Subject: Re: ECPG FETCH readahead
Date: 2012-04-17 04:02:34
Message-ID: 4F8CEB5A.100@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2012-04-17 05:52 keltezéssel, Michael Meskes írta:
> On Mon, Apr 16, 2012 at 07:18:07PM +0200, Boszormenyi Zoltan wrote:
>> OK. I would like to stretch your agreement a little. :-)
>> ...
> Yeah, you got a point here.
>
>> By the new FETCH request. Instead of the above, I imagined this:
>> - the runtime notices that the new request is larger than the current
>> readahead window size, modifies the readahead window size upwards,
>> so the next FETCH will use it
>> - serve the request's first 128 rows from the current cache
>> - for the 129th row, FETCH 1024 will be executed and the remaining
>> 768 rows will be served from the new cache
> That means window size goes up to 1024-128 for that one case?

I listed two scenarios.
1. occasional bump of the readahead window for large requests,
for smaller requests it uses the originally set size
2. permanent bump of the readahead window for large requests
(larger than previously seen), all subsequent requests use
the new size

Both can be implemented easily, which one do you prefer?
If you always use very large requests, 1) behaves like 2)

>
>> - all subsequent requests use the new readahead size, 1024
> Sounds reasonable to me.
>
>> So, there can be occasional one-time larger requests but
>> smaller ones should apply the set window size, right?
> Yes. I do agree that FETCH N cannot fetch N all the time, but please make it
> work like what you suggested to make sure people don't have to recompile.
>
> Michael

--
----------------------------------
Zoltán Böszörményi
Cybertec Schönig& Schönig GmbH
Gröhrmühlgasse 26
A-2700 Wiener Neustadt, Austria
Web: http://www.postgresql-support.de
http://www.postgresql.at/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Meskes 2012-04-17 04:48:19 Re: ECPG FETCH readahead
Previous Message Michael Meskes 2012-04-17 03:52:08 Re: ECPG FETCH readahead