pg.ddx.io pgsql-odbc@postgresql.org mailing list archive
help / color / mirror / Atom feedCritical Bug with UseDeclareFetch in development version
4+ messages / 3 participants
[nested] [flat]
* Critical Bug with UseDeclareFetch in development version
@ 2005-09-06 14:52 Marko Ristola <Marko.Ristola@kolumbus.fi>
2005-09-06 16:35 ` Re: Critical Bug with UseDeclareFetch in development version Hiroshi Saito <saito@inetrt.skcapi.co.jp>
0 siblings, 1 reply; 4+ messages in thread
From: Marko Ristola @ 2005-09-06 14:52 UTC (permalink / raw)
To: Dave Page <dpage@vale-housing.co.uk>; +Cc: pgsql-odbc; Anoop Kumar <anoopk@pervasive-postgres.com>
There is one inconvinient bug in the driver:
I tested this with the very least CVS version, so it exists.
psql
> select * from test1;
(104 rows)
isql marko XXX
2 rows returned
So I get the above result by configuring .odbc.ini:
[marko]
Fetch = 2
UseDeclareFetch = 1
So unfortunately it fetches too few rows.
Old behaviour:
1. SELECT * from test1 with cursor STM7737819
2. While more rows; do Fetch at most 2 rows; done
3. CLOSE CURSOR maybe with STMT_DROP.
So this hack was implemented to support SELECT * of more than
a few million rows.
So without this hack, with 32 bit operating systems, query results are
limited
into maybe 8 million rows, before memory allocation failure. I don't
remember
the exact number of millions. Of course the exact million depends
heavily with the result row width and with the Operating system memory
architecture.
So, it seems that the hack implementation has been partially removed,
but it is still active.
Regards,
Marko Ristola
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Critical Bug with UseDeclareFetch in development version
2005-09-06 14:52 Critical Bug with UseDeclareFetch in development version Marko Ristola <Marko.Ristola@kolumbus.fi>
@ 2005-09-06 16:35 ` Hiroshi Saito <saito@inetrt.skcapi.co.jp>
2005-09-06 19:17 ` Re: Critical Bug with UseDeclareFetch in development version Marko Ristola <Marko.Ristola@kolumbus.fi>
0 siblings, 1 reply; 4+ messages in thread
From: Hiroshi Saito @ 2005-09-06 16:35 UTC (permalink / raw)
To: Marko Ristola <Marko.Ristola@kolumbus.fi>; Dave Page <dpage@vale-housing.co.uk>; +Cc: pgsql-odbc; Anoop Kumar <anoopk@pervasive-postgres.com>
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
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Critical Bug with UseDeclareFetch in development version
2005-09-06 14:52 Critical Bug with UseDeclareFetch in development version Marko Ristola <Marko.Ristola@kolumbus.fi>
2005-09-06 16:35 ` Re: Critical Bug with UseDeclareFetch in development version Hiroshi Saito <saito@inetrt.skcapi.co.jp>
@ 2005-09-06 19:17 ` Marko Ristola <Marko.Ristola@kolumbus.fi>
0 siblings, 0 replies; 4+ messages in thread
From: Marko Ristola @ 2005-09-06 19:17 UTC (permalink / raw)
To: Hiroshi Saito <saito@inetrt.skcapi.co.jp>; +Cc: Dave Page <dpage@vale-housing.co.uk>; pgsql-odbc; Anoop Kumar <anoopk@pervasive-postgres.com>
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
>
>
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Critical Bug with UseDeclareFetch in development version
@ 2005-09-07 08:10 Dave Page <dpage@vale-housing.co.uk>
0 siblings, 0 replies; 4+ messages in thread
From: Dave Page @ 2005-09-07 08:10 UTC (permalink / raw)
To: Marko Ristola <Marko.Ristola@kolumbus.fi>; Hiroshi Saito <saito@inetrt.skcapi.co.jp>; +Cc: pgsql-odbc; Anoop Kumar <anoopk@pervasive-postgres.com>; Sivakumar K <sivakumark@pervasive-postgres.com>
> -----Original Message-----
> From: Marko Ristola [mailto:Marko.Ristola@kolumbus.fi]
> Sent: 06 September 2005 20:17
> To: Hiroshi Saito
> Cc: Dave Page; pgsql-odbc@postgresql.org; Anoop Kumar
> Subject: Re: [ODBC] Critical Bug with UseDeclareFetch in
> development version
>
> Now it just understands, that the FETCH returned two rows,
> and after the two rows, it will not fetch more rows anymore.
Yes, I can confirm this. A cursor is used to retrieve the first N rows
(where N is the value of the 'fetch' parameter), but doesn't then get
any more when requested.
Anoop, Sivakumar - I guess this is fairly trivial for one of you to fix
(I'm not familiar with that part of the code). I guess it's just a case
of fetching the next 'fetch' rows when the last one or, for example, the
one at fetch/10 from the end of the set is accessed by the client. Can
you look at it please?
Regards, Dave.
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2005-09-07 08:10 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-09-06 14:52 Critical Bug with UseDeclareFetch in development version Marko Ristola <Marko.Ristola@kolumbus.fi>
2005-09-06 16:35 ` Hiroshi Saito <saito@inetrt.skcapi.co.jp>
2005-09-06 19:17 ` Marko Ristola <Marko.Ristola@kolumbus.fi>
2005-09-07 08:10 Re: Critical Bug with UseDeclareFetch in development version Dave Page <dpage@vale-housing.co.uk>
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