Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 0A7A99FBE67 for ; Wed, 27 Jun 2007 13:05:49 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 79345-05 for ; Wed, 27 Jun 2007 13:05:44 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from yucaipaco.com (yucaipaco.com [82.165.181.113]) by postgresql.org (Postfix) with ESMTP id 9D2D99FBE5A for ; Wed, 27 Jun 2007 13:05:44 -0300 (ADT) Received: (qmail 992 invoked by uid 210); 27 Jun 2007 09:08:19 -0700 Received: from 10.23.112.225 by yucmail (envelope-from , uid 201) with qmail-scanner-1.25st (clamdscan: 0.90.2/3399. f-prot: 4.6.7/3.16.15. spamassassin: 3.1.8. perlscan: 1.25st. Clear:RC:1(10.23.112.225):. Processed in 0.488984 secs); 27 Jun 2007 16:08:19 -0000 Received: from unknown (HELO ?10.23.112.225?) (yucrelay@10.23.112.225) by yucaipaco.com with ESMTPA; 27 Jun 2007 09:08:19 -0700 Message-ID: <46828A2E.6020201@gardnerit.net> Date: Wed, 27 Jun 2007 09:02:54 -0700 From: David Gardner User-Agent: Thunderbird 2.0.0.4 (X11/20070618) MIME-Version: 1.0 To: pgsql-odbc@postgresql.org Subject: Re: Why is UseDeclareFetch so slow? References: <4681B973.6080101@tpf.co.jp> <6ft483p1sfcupaid9hb778vsj3cg3bnlnh@4ax.com> In-Reply-To: <6ft483p1sfcupaid9hb778vsj3cg3bnlnh@4ax.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200706/57 X-Sequence-Number: 9046 It has been my experience, which is largely with Access as a client, already attempts to perform similar optimizations to my queries. Often Access will take a query like: SELECT * FROM PersonTbl; and turn it into: SELECT * FROM PersonTbl WHERE "PersonID" = 10566 OR "PersonID" = 10568 OR "PersonID" = 10365 OR "PersonID" = 10705 OR "PersonID" = 10390 OR "PersonID" = 10391 OR "PersonID" = 10392 OR "PersonID" = 10447 OR "PersonID" = 10403 OR "PersonID" = 10414; > Yes, but the real question is why is the query 4 times slower when > UseDeclareFetch is enabled (FETCH was set to 100)? > > I would have expected that the ODBC driver is fetching 100 rows in advance and > thus the query should execute in less than a second instead of 30 seconds. > > Rainer > > ---------------------------(end of broadcast)--------------------------- > TIP 2: Don't 'kill -9' the postmaster >