X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id A33BF52861 for ; Thu, 16 Jun 2005 11:47:24 -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 62971-05 for ; Thu, 16 Jun 2005 14:47:20 +0000 (GMT) Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by svr1.postgresql.org (Postfix) with ESMTP id E83F75283D for ; Thu, 16 Jun 2005 11:47:19 -0300 (ADT) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1DivYl-0001aO-0f for pgsql-sql@postgresql.org; Thu, 16 Jun 2005 16:41:35 +0200 Received: from gateway.mgm-edv.de ([212.18.1.110]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 16 Jun 2005 16:41:34 +0200 Received: from spam_eater by gateway.mgm-edv.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 16 Jun 2005 16:41:34 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-sql@postgresql.org From: Thomas Kellerer Subject: Re: SELECT very slow Date: Thu, 16 Jun 2005 16:45:35 +0200 Lines: 18 Message-ID: References: <1118930439.3382.91.camel@state.g2switchworks.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: gateway.mgm-edv.de User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de-AT; rv:1.7.6) Gecko/20050319 Mnenhy/0.7.2.0 X-Accept-Language: de, de-at, en-us, en In-Reply-To: <1118930439.3382.91.camel@state.g2switchworks.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.155 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200506/197 X-Sequence-Number: 21798 On 16.06.2005 16:00 Scott Marlowe wrote: > There's got to be more happening than what this is showing us. A > select, and looping through it, should involve no writes, and therefore > no real performance difference from autocommit versus not. Is there > some underlying trigger on the view or something like that? Some kind > of auditing function? That's exactly the code that produced the mentioned timings. This is - according to the JDBC driver's documentation - the expected behaviour. The driver can be set to use cursor based fetching but *only* if autocommit is false. If autocommit is on (or fetch size is zero) then the driver will build the whole result set before returning to the caller. http://jdbc.postgresql.org/documentation/80/query.html#query-with-cursor Thomas