Re: ECPG FETCH readahead - Mailing list pgsql-hackers

From PostgreSQL - Hans-Jürgen Schönig
Subject Re: ECPG FETCH readahead
Date
Msg-id 4798EC85-C0B4-4332-B344-AC41DA3BF95C@cybertec.at
Whole thread Raw
In response to Re: ECPG FETCH readahead  (Michael Meskes <meskes@postgresql.org>)
List pgsql-hackers
On Jun 24, 2010, at 2:13 PM, Michael Meskes wrote:

>> I think, yes, it does make sense. Because we are talking
>> about porting a whole lot of COBOL applications.
>
> COBOL???
>


yes, COBOL :).
it is much more common than people think.
it is not the first COBOL request for PostgreSQL hitting my desk.
in our concrete example we are using a C module written with ECPG which is magically attached to tons of COBOL code ...



>> The ESQL/C or ECPG connector was already written
>> the Informix quirks in mind, so it fetches only one record
>> at a time passing it to the application. And similar performance
>> is expected from ECPG - which excpectation is not fulfilled
>> currently because libecpg doesn't do the same caching as
>> ESQL/C does.
>
> Eh, you are talking about a program you wrote for your customer or they wrote
> themselves, right? I simply refuse to add this stuff only to fix this situation
> for that one customer of yours if it only hits them. Now the thing to discuss
> is how common is this situation.
>
> Michael


i think that this cursor issue is a pretty common thing for many codes.
people are usually not aware of the fact that network round trips and parsing which are naturally related to "FETCH 1"
area lot more expensive than fetching one row somewhere deep inside the DB engine.  
out there there are many applications which fetch data row by row. if an app fetches data row by row in PostgreSQL it
willbe A LOT slower than in, say, Informix because most commercial database clients will cache data inside a cursor
behindthe scenes to avoid the problem we try to solve. 

currently we are talking about a performance penalty of factor 5 or so. so - it is not a small thing; it is a big
difference.
regards,
    hans

--
Cybertec Schönig & Schönig GmbH
Gröhrmühlgasse 26
A-2700 Wiener Neustadt, Austria
Web: http://www.postgresql-support.de



pgsql-hackers by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: TCP keepalive support for libpq
Next
From: Böszörményi Zoltán
Date:
Subject: Re: ECPG FETCH readahead