X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 866B2D1B1AB for ; Fri, 9 Jul 2004 17:44:47 -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 89434-08 for ; Fri, 9 Jul 2004 20:44:42 +0000 (GMT) Received: from mail63.csoft.net (leary3.csoft.net [63.111.22.74]) by svr1.postgresql.org (Postfix) with SMTP id 8B6E4D1B18F for ; Fri, 9 Jul 2004 17:44:39 -0300 (ADT) Received: (qmail 32093 invoked by uid 1112); 9 Jul 2004 20:44:32 -0000 Date: Fri, 9 Jul 2004 15:44:32 -0500 (EST) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: Bill Chandler Cc: pgsql-performance@postgresql.org, pgsql-jdbc@postgresql.org Subject: Re: Cursors performance (was: Re: [PERFORM] Terrible performance In-Reply-To: <20040709202416.54013.qmail@web51401.mail.yahoo.com> Message-ID: References: <20040709202416.54013.qmail@web51401.mail.yahoo.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200407/68 X-Sequence-Number: 10452 On Fri, 9 Jul 2004, Bill Chandler wrote: > Thanks to all who have responded. I now think my > problem is not related to deleting/recreating indexes. > Somehow it is related to JDBC cursors. It appears > that what is happening is that since I'm using > a fetch size of 5000, the command: > > FETCH FORWARD 5000 FROM JDBC_CURS_1 > If the top level node of your execution plan is a sort step, it should take essentially no time to retrieve additional rows after the first fetch. The sort step is materializes the results so that future fetches simply need to spit this data back to the client. I would agree with Dave's suggestion to use log_duration and compare the values for the first and subsequent fetches. Kris Jurka