Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id D8A51633398 for ; Wed, 16 Dec 2009 12:36:33 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 31348-01-2 for ; Wed, 16 Dec 2009 16:36:26 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from outbound.vnet-inc.com (outbound.vnet-inc.com [216.146.104.103]) by mail.postgresql.org (Postfix) with ESMTP id 3EF12633320 for ; Wed, 16 Dec 2009 12:36:24 -0400 (AST) Received: from [192.168.157.32] (unknown [216.129.226.141]) by outbound.vnet-inc.com (Postfix) with ESMTP id 785555A9E; Wed, 16 Dec 2009 09:36:22 -0700 (MST) Message-ID: <4B290928.5080004@ttc-cmc.net> Date: Wed, 16 Dec 2009 09:22:00 -0700 From: dmp User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.13) Gecko/20060417 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Alexander Pyhalov , pgsql-jdbc@postgresql.org Subject: Re: Get bytes sent to client References: <4B2894E7.80407@rsu.ru> <4B28A86A.3060506@rsu.ru> In-Reply-To: <4B28A86A.3060506@rsu.ru> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 200912/50 X-Sequence-Number: 20131 I have had similar interest in my applications raw byte traffic on the network and just ended up using on Linux iptraf monitor. You can reset it then execute a query in the client to see exactly the bytes being transmitted/received. I'm sure there must be something similar for other platforms. danap. > I had some thoughts about extending ProtocolConnectionImpl, PGStream > and so on (to account bytes on client side, when PGStream calls > pg_input methods), but they have a lot of private fields and > methods... It is also is quite time-consuming... Are there any other > ideas? The idea is to account size of raw data sent to client... > > Alexander Pyhalov wrote: > >> Hello. >> I'd like to collect some statistics in my application (using JDBC). >> In Oracle I could collect data, sent to client, using the following >> query: >> >> SELECT S.value FROM V$MYSTAT S,SYS.V_$STATNAME NAMES >> WHERE NAMES.STATISTIC#=S.STATISTIC# >> AND NAMES.NAME='bytes sent via SQL*Net to client'; >> >> Can I do something like this in PostgreSQL? I'd like to estimate >> query result size, to be more precise, amount of network traffic, >> which is generated in response to a query. >>