Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id CDD839FB28A for ; Sun, 28 Jan 2007 11:51:26 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-new, port 10024) with ESMTP id 45923-10 for ; Sun, 28 Jan 2007 11:51:22 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from www01.kensystem.com (www01.kensystem.com [72.19.170.120]) by postgresql.org (Postfix) with ESMTP id E078E9FB1C6 for ; Sun, 28 Jan 2007 11:51:22 -0400 (AST) Received: from 192.168.0.3 by www01.kensystem.com (SMTPD); id s20070128155118.21783; Sun, 28 Jan 2007 15:51:18 Message-ID: <45BCC675.5050000@kensystem.com> Date: Sun, 28 Jan 2007 08:51:17 -0700 From: Ken Johanson User-Agent: Thunderbird 1.5.0.9 (Windows/20061207) MIME-Version: 1.0 To: Kris Jurka CC: pgsql-jdbc@postgresql.org Subject: Re: Synthesize support for Statement.getGeneratedKeys()? References: <4580E681.3080106@kensystem.com> <45B986CB.70100@kensystem.com> In-Reply-To: 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: 200701/176 X-Sequence-Number: 16541 >> In implementing Statement.executeUpdate(String sql,String[] >> columnNames), does any know how I could go about sending the sql and >> subsequent RETURNING clause directly to a stream? Just so I can avoid >> double-buffering the query (allocated in the sql, and second in the >> StringBuffer I'd be appending the RETURNING clause to). > > Don't worry about this minor overhead. So much other manipulation and > object creation happens (even forgetting the network trip) that this > will be in the noise. > Hmm, this might be an area I'd enjoy contributing code for.. if there are places now where there is avoidable double or triple allocation (like in my patch) (where it could instead be handled by streams and/or finer grained chunks), and since the driver (apparently) already has some stream based utils... maybe I could try to improve those. I know from experience with other tools that unnec allocation can play havoc under high load and/or very large data sets, using (resizeable) buffers (like StringBuffer). When that code gets optimized the application becomes much more responsive. If you know of any places in the driver that could benefit from this, please let me know. ken