pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Marko Ristola <Marko.Ristola@kolumbus.fi>
To: Joel Fradkin <jfradkin@wazagua.com>
Cc: pgsql-odbc@postgresql.org
Subject: Re: using cursors?
Date: Thu, 14 Jul 2005 09:09:56 +0300
Message-ID: <42D601B4.9040609@kolumbus.fi> (raw)
In-Reply-To: <001a01c587bf$cca62130$797ba8c0@jfradkin>
References: <001a01c587bf$cca62130$797ba8c0@jfradkin>


Correct with UseDeclareFetch:

"UseDeclareFetch = 1 activates the internal cursor usage
in SELECT queries with low memory consumption,
in psqlodbc. I don't know about other ODBC drivers.

"Fetch = 100" informs the psqlodbc driver: UseDeclareFetch fetches at
most 100 rows at a time.
(with 101 result rows, the backend delivers with first "cursor fetch"
the 100 rows. Next time only one row will be delivered).

My opinion is, that 100 is high enough. With 1000 rows, the
crash risk is much higher. It might be, that with 32, the speed
is slightly better: It might be, that if the whole data fits into the CPU
cache in Windows, the performance is at it's best:
my laptop is extremely fast, and that seems, that it is so,
because of 1 meg CPU cache. With 256k cache the speed decreases.


You can confirm the cursor usage with ODBC trace:

Trace=1
CommLog=1
Debug=1

This will store debug information into mylog... files
and psqodbc* files.

The following information will show the cursor usage
in mylog*.log:

stmt='select count(*) from test1'
stmt_with_params = 'declare SQL_CUR0x808d760 cursor for select count(*) from
test1'

So, here I issued the command
"select count(*) from test1".
Psqlodbc changed it into "declare XXX cursor for select
count(*) from test1"

Marko Ristola

Joel Fradkin wrote:

> Is this a setting in the connection string?
>
> UseDeclareFetch=0;
>
> Sorry for asking dumb questions, guess I will dig out the manual and
> start R&D.
>
>  
>
> Joel Fradkin
>
>  
>
> Wazagua, Inc.
> 2520 Trailmate Dr
> Sarasota, Florida 34243
> Tel.  941-753-7111 ext 305
>
>  
>
> jfradkin@wazagua.com <mailto:jfradkin@wazagua.com>
> www.wazagua.com <http://www.wazagua.com;
> Powered by Wazagua
> Providing you with the latest Web-based technology & advanced tools.
> © 2004. WAZAGUA, Inc. All rights reserved. WAZAGUA, Inc
>  This email message is for the use of the intended recipient(s) and
> may contain confidential and privileged information.  Any unauthorized
> review, use, disclosure or distribution is prohibited.  If you are not
> the intended recipient, please contact the sender by reply email and
> delete and destroy all copies of the original message, including
> attachments.
>
>  
>
>
>  
>
>  
>




view thread (2+ messages)

Message-ID: <42D601B4.9040609@kolumbus.fi>
Permalink:  ../42D601B4.9040609@kolumbus.fi/
Also on:    postgresql.org/message-id/42D601B4.9040609@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, jfradkin@wazagua.com
  Subject: Re: using cursors?
  In-Reply-To: <42D601B4.9040609@kolumbus.fi>
  References: <001a01c587bf$cca62130$797ba8c0@jfradkin> <42D601B4.9040609@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