Skip site navigation (1) Skip section navigation (2)

Re: using cursors?

From: Marko Ristola <Marko(dot)Ristola(at)kolumbus(dot)fi>
To: Joel Fradkin <jfradkin(at)wazagua(dot)com>
Cc: pgsql-odbc(at)postgresql(dot)org
Subject: Re: using cursors?
Date: 2005-07-14 06:09:56
Message-ID: 42D601B4.9040609@kolumbus.fi (view raw or flat)
Thread:
Lists: pgsql-odbc
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(at)wazagua(dot)com <mailto:jfradkin(at)wazagua(dot)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.
>
>  
>
>
>  
>
>  
>


In response to

pgsql-odbc by date

Next:From: MinalDate: 2005-07-14 06:53:50
Subject: pgsql-odbc
Previous:From: Greg CampbellDate: 2005-07-13 20:47:48
Subject: Re: MS Access and #deleted due to timeouts

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group