X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id BAD2A52C2B for ; Thu, 14 Jul 2005 03:10:00 -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 85233-09 for ; Thu, 14 Jul 2005 06:09:58 +0000 (GMT) Received: from fep02-app.kolumbus.fi (fep02-0.kolumbus.fi [193.229.0.44]) by svr1.postgresql.org (Postfix) with ESMTP id 638EA52D48 for ; Thu, 14 Jul 2005 03:09:56 -0300 (ADT) Received: from [192.168.1.101] (really [193.229.230.202]) by fep02-app.kolumbus.fi with ESMTP id <20050714060956.VPEG2115.fep02-app.kolumbus.fi@[192.168.1.101]>; Thu, 14 Jul 2005 09:09:56 +0300 Message-ID: <42D601B4.9040609@kolumbus.fi> Date: Thu, 14 Jul 2005 09:09:56 +0300 From: Marko Ristola User-Agent: Debian Thunderbird 1.0.2 (X11/20050331) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Joel Fradkin Cc: pgsql-odbc@postgresql.org Subject: Re: using cursors? References: <001a01c587bf$cca62130$797ba8c0@jfradkin> In-Reply-To: <001a01c587bf$cca62130$797ba8c0@jfradkin> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.331 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200507/50 X-Sequence-Number: 5516 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 > 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. > > > > > > > >