Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 800BCB5DBC6 for ; Sat, 18 Jun 2011 23:11:20 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 48312-03 for ; Sun, 19 Jun 2011 02:11:14 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mail.postgresql.org (Postfix) with ESMTP id 4FF13B5DBC2 for ; Sat, 18 Jun 2011 23:11:14 -0300 (ADT) Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p5J2BDJ9025400 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sat, 18 Jun 2011 22:11:13 -0400 Received: from [10.11.9.34] (vpn-9-34.rdu.redhat.com [10.11.9.34]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p5J2BCMg009650 for ; Sat, 18 Jun 2011 22:11:13 -0400 Subject: ODBC Performance slow for large results From: Ramesh Reddy Reply-To: rareddy@redhat.com To: pgsql-odbc@postgresql.org Content-Type: text/plain; charset="UTF-8" Organization: Red Hat Date: Sat, 18 Jun 2011 21:06:16 -0500 Message-ID: <1308449176.6498.26.camel@localhost.localdomain> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201106/14 X-Sequence-Number: 10672 Hi, I am not using "UseDeclareFetch" and using "UseServerSidePrepare=1", but we see over 40 mins for fetching over million rows between couple powerful machines. Debug/trace is not in use either. I am using Redhat Linux machines for both server and client. I am using prepare statements. I using a small perl utility for testing, but results are same with isql too. I have read though the ODBC code, couple things I observed was 1) All the tuples from the server are pre-fetched before a single row is returned to user. So, million rows are fetched to driver first (I was not sure whether these are all memory resident or written to temp disk space). So can somebody comment on memory implications? I see this operation is completed fairly quickly, noting the fact that PG server is responsive in returning and no network delays seen. We are also ran independent tests to make sure we are running in full duplex. 2) From the debug logs, we seen significant time spent on "copy and convert" operation, where the text response from PG server is being converted to respective data types. Is there any way I can configure PG database and ODBC driver to return the data in "binary" format, to minimize this step? I do see CPU utilization being pegged during operation. Any way to re-compile *may be* to make both 1 & 2 above occur in parallel to minimize times? Or any other techniques any one can suggest, I would really appreciate it. Thank you in advance for any advise you can share. Ramesh..