Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 9044D9FA0EF for ; Tue, 12 Dec 2006 12:47:28 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-new, port 10024) with ESMTP id 46640-01 for ; Tue, 12 Dec 2006 12:47:03 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.174]) by postgresql.org (Postfix) with ESMTP id 9D0BE9F946C for ; Tue, 12 Dec 2006 12:47:02 -0400 (AST) Received: by ug-out-1314.google.com with SMTP id k3so1749061ugf for ; Tue, 12 Dec 2006 08:47:00 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding:sender; b=kiXG7KRRs/beBDwnCBmNXktlvh/FwLcC82cYtLaR9mMaqJ0RX2JdQdKGg5AsDFKO5F3hKAN7c7rbBZPNj5VQHTpihdEila/HXmNtrXR6XePjIfiaKr/11oeRiQ2Sv+e2WArmS7JfUtCzPAu6iJPNpQ+TlAjWjdLmuNH8Vg5QMo4= Received: by 10.78.47.15 with SMTP id u15mr4144520huu.1165941644266; Tue, 12 Dec 2006 08:40:44 -0800 (PST) Received: from ?192.168.0.20? ( [62.232.55.118]) by mx.google.com with ESMTP id 36sm4279916huc.2006.12.12.08.40.42; Tue, 12 Dec 2006 08:40:43 -0800 (PST) Message-ID: <457EDB8D.4070605@enterprisedb.com> Date: Tue, 12 Dec 2006 16:40:45 +0000 From: Heikki Linnakangas User-Agent: Icedove 1.5.0.8 (X11/20061116) MIME-Version: 1.0 To: Christian Dannemann CC: pgsql-jdbc@postgresql.org Subject: Re: prepared statements References: <457EC5F5.9090402@merus.co.uk> In-Reply-To: <457EC5F5.9090402@merus.co.uk> 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: 200612/58 X-Sequence-Number: 16290 Christian Dannemann wrote: > Hello All, > > We are currently experimenting with a postgresql cluster database > (pgcluster 1.5rc11). > > The cluster replicates all prepared statements across all database > servers (which makes sense if they are for updates and inserts). It also > does this for normal select statements. > > That means that when using prepared statements, there is absolutely NO > gain from using a db cluster. Everything is executed in every database. > And there is the additional overhead of replicating that across. So huge > investment in hardware, and a performance loss is the gain from that :-( In the future, I'd suggest doing more testing before making huge investments in hardware... > Our application is written in java and we use the jdbc postgresql driver. > > Now it appears that this driver issues ANY statement as a prepared > statement. I've tried to switch this off but to no avail. This is a huge > nightmare and I don't quite understand why it is deemed necessary to > issue every simple select statement as a prepared statement. As Kris said, you really should be blaming pgcluster, and you can set the protocolVersion parameter if you need to. There's better alternatives to pgcluster, for example Sequoia (http://sequoia.continuent.org/), or Slony (http://slony.info/) -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com