pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Marko Ristola <Marko.Ristola@kolumbus.fi>
To: Hiroshi Saito <saito@inetrt.skcapi.co.jp>
Cc: Dave Page <dpage@vale-housing.co.uk>
Cc: pgsql-odbc@postgresql.org
Cc: Anoop Kumar <anoopk@pervasive-postgres.com>
Subject: Re: Critical Bug with UseDeclareFetch in development version
Date: Tue, 06 Sep 2005 22:17:27 +0300
Message-ID: <431DEB47.3000609@kolumbus.fi> (raw)
In-Reply-To: <011a01c5b301$01e39b40$01324d80@hiroshi5jz7dqj>
References: <E7F85A1B5FF8D44C8A1AF6885BC9A0E4AC9EAB@ratbert.vale-housing.co.uk>
	<431DAD14.6070601@kolumbus.fi>
	<011a01c5b301$01e39b40$01324d80@hiroshi5jz7dqj>


Maybe those with more than 8 million row tables could move on into 64 bit
operating systems. Memory hogging would not be a problem anymore with a
big enough swap space.

So making sure the feature would not be active, would fix it.
PostgreSQL works with a bad performance with UseDeclareFetch by design.
With UseDeclareFetch, the backend assumes, that only a few rows will be
fetched.

Maybe users are not prepared to move on so quickly into 64 bit.

Now to the analyze of the problem:

The problem seems to be, that
with UseDeclareFetch=1
and Fetch=2, libpq psqlodbc driver does the FETCH
only once for the PostgreSQL backend.

The feature would be nice, if PGAPI_ExtendedFetch() could
fetch more tuples with FETCH from the backend,
when the first two tuples have been processed.

Now it just understands, that the FETCH returned two rows,
and after the two rows, it will not fetch more rows anymore.

So I tracked down the problem with a debugger into PGAPI_ExtendedFetch.

It seems that the ealier implementation was, that SQLFetch called somehow

QR_fetch_tuples() to fetch more rows from the Backend.
If QR_fetch_tuples() didn't return more rows, the fetching from the backend
would stop.

If the user application asks the number of rows, the ODBC driver is forced
to read everything into the memory.


Regards,
Marko Ristola

Hiroshi Saito wrote:

>Hi Marko.
>
>It is strange...
>
>  
>
>>So I get the above result by configuring .odbc.ini:
>>[marko]
>>Fetch = 2
>>UseDeclareFetch = 1
>>    
>>
>
>I do not find any problems by the driver for Windows. 
>Probably, I think a portion peculiar to Linux version.??
>In windows, though CACHE is used as FETCH.
>
>Although I want to see the log, Anoop or Dave may be able to 
>be distinguished immediately.:-)
>
>Regards,
>Hiroshi Saito 
>
>
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 1: if posting/reading through Usenet, please send an appropriate
>       subscribe-nomail command to majordomo@postgresql.org so that your
>       message can get through to the mailing list cleanly
>  
>




view thread (4+ messages)  latest in thread

Message-ID: <431DEB47.3000609@kolumbus.fi>
Permalink:  ../431DEB47.3000609@kolumbus.fi/
Also on:    postgresql.org/message-id/431DEB47.3000609@kolumbus.fi

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-odbc@postgresql.org
  Cc: Marko.Ristola@kolumbus.fi, saito@inetrt.skcapi.co.jp, dpage@vale-housing.co.uk, anoopk@pervasive-postgres.com
  Subject: Re: Critical Bug with UseDeclareFetch in development version
  In-Reply-To: <431DEB47.3000609@kolumbus.fi>
  References: <E7F85A1B5FF8D44C8A1AF6885BC9A0E4AC9EAB@ratbert.vale-housing.co.uk> <431DAD14.6070601@kolumbus.fi> <011a01c5b301$01e39b40$01324d80@hiroshi5jz7dqj> <431DEB47.3000609@kolumbus.fi>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox