X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 78377D8868 for ; Tue, 6 Sep 2005 16:17:32 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 57018-04 for ; Tue, 6 Sep 2005 19:17:28 +0000 (GMT) Received: from fep06-app.kolumbus.fi (fep06-0.kolumbus.fi [193.229.0.57]) by svr1.postgresql.org (Postfix) with ESMTP id 7F01ED8874 for ; Tue, 6 Sep 2005 16:17:27 -0300 (ADT) Received: from [192.168.1.101] (really [80.186.85.167]) by fep06-app.kolumbus.fi with ESMTP id <20050906191727.XTOZ27547.fep06-app.kolumbus.fi@[192.168.1.101]>; Tue, 6 Sep 2005 22:17:27 +0300 Message-ID: <431DEB47.3000609@kolumbus.fi> Date: Tue, 06 Sep 2005 22:17:27 +0300 From: Marko Ristola User-Agent: Debian Thunderbird 1.0.2 (X11/20050817) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Hiroshi Saito Cc: Dave Page , pgsql-odbc@postgresql.org, Anoop Kumar Subject: Re: Critical Bug with UseDeclareFetch in development version References: <431DAD14.6070601@kolumbus.fi> <011a01c5b301$01e39b40$01324d80@hiroshi5jz7dqj> In-Reply-To: <011a01c5b301$01e39b40$01324d80@hiroshi5jz7dqj> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.106 required=5 tests=[AWL=0.056, FORGED_RCVD_HELO=0.05] X-Spam-Level: X-Archive-Number: 200509/76 X-Sequence-Number: 5974 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 > >