X-Original-To: pgsql-jdbc-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id DE4FF9FA7B6 for ; Tue, 11 Jul 2006 15:28:23 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 00963-05 for ; Tue, 11 Jul 2006 15:28:12 -0300 (ADT) X-Greylist: delayed 00:25:24.991373 by SQLgrey- Received: from smtp.ini.unizh.ch (dns.ini.unizh.ch [130.60.230.185]) by postgresql.org (Postfix) with ESMTP id 5BBA99FA666 for ; Tue, 11 Jul 2006 15:28:11 -0300 (ADT) Received: from smtp.ini.unizh.ch (localhost [127.0.0.1]) by smtp.ini.unizh.ch (Postfix) with ESMTP id CDF0C85C8CA for ; Tue, 11 Jul 2006 20:28:10 +0200 (CEST) Received: by smtp.ini.unizh.ch (Postfix, from userid 499) id C1F1D85C8CC; Tue, 11 Jul 2006 20:28:10 +0200 (CEST) Received: from [192.168.0.2] (dhcp226-12.obee.ucla.edu [164.67.12.226]) (using TLSv1 with cipher EXP1024-RC4-SHA (56/128 bits)) (No client certificate requested) by smtp.ini.unizh.ch (Postfix) with ESMTP id 8D22085C8CA for ; Tue, 11 Jul 2006 20:28:00 +0200 (CEST) From: Albert Cardona To: pgsql-jdbc@postgresql.org Subject: how to monitor the amount of bytes fetched in a executeQuery() ? Date: Tue, 11 Jul 2006 11:27:42 -0700 User-Agent: KMail/1.9.1 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200607111127.42790.acardona@ini.phys.ethz.ch> X-Virus-Scanned: ClamAV using ClamSMTP X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200607/37 X-Sequence-Number: 15463 Hi all, I have a system in which large (13Mb) images are stored in the database as compressed bytea column entries. When fetching from the local computer it's fast enough the lag is not noticeable. When fetching remotely at 1Mb LAN speed, about 15 seconds elapse. After timing the executeQuery() and the getBinaryStream(), the first takes about 15 seconds and the second about 3. So it looks like the executeQuery() is actually downloading the image, and the getBinaryStream is merely copying it from a local resource. Is that right? Is there any way in which the number of bytes fetched in a query or for a particular column can be monitored, so I can display a more accurate and elaborated waiting dialog in my application? Thanks for any hints. Albert -- Albert Cardona Molecular Cell Developmental Biology University of California Los Angeles Tel +1 310 2067376 Programming: http://www.ini.unizch.ch/~acardona/trakem2.html Research: http://www.mcdb.ucla.edu/Research/Hartenstein/ Web design: http://www.pixelets.com