X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 1C0A9329CA4 for ; Fri, 24 Sep 2004 00:48:39 +0100 (BST) 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 27822-05 for ; Thu, 23 Sep 2004 23:48:26 +0000 (GMT) Received: from mail63.csoft.net (leary3.csoft.net [63.111.22.74]) by svr1.postgresql.org (Postfix) with SMTP id 964A5329E4C for ; Fri, 24 Sep 2004 00:48:26 +0100 (BST) Received: (qmail 27753 invoked by uid 1112); 23 Sep 2004 23:47:59 -0000 Date: Thu, 23 Sep 2004 18:47:59 -0500 (EST) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: Stephen Crowley Cc: pgsql-performance@postgresql.org Subject: Re: Large # of rows in query extremely slow, not using In-Reply-To: <3f71fdf104092316367c5f3052@mail.gmail.com> Message-ID: References: <3f71fdf104091317515c756512@mail.gmail.com> <28088.1095124267@sss.pgh.pa.us> <3f71fdf104091318228099815@mail.gmail.com> <28432.1095126554@sss.pgh.pa.us> <3f71fdf104091323047de7bb01@mail.gmail.com> <3f71fdf104092316367c5f3052@mail.gmail.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: 200409/261 X-Sequence-Number: 8389 On Thu, 23 Sep 2004, Stephen Crowley wrote: > Thanks for the explanation. So what sort of changes need to be made to > the client/server protocol to fix this problem? The problem is that there is no way to indicate why you are using a particular statement in the extended query protocol. For the JDBC driver there are two potential reasons, streaming a ResultSet and using a server prepared statement. For the streaming as default case you desire there needs to be a way to indicate that you don't want to create a generic server prepared statement and that this query is really just for one time use, so it can generate the best plan possible. Additionally you can only stream ResultSets that are of type FORWARD_ONLY. It would also be nice to be able to specify scrollability and holdability when creating a statement and the offset/direction when streaming data from a scrollable one. Kris Jurka