Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f2Qgg-0002XX-9Z for pgsql-general@arkaria.postgresql.org; Sun, 01 Apr 2018 00:17:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f2Qge-0003JE-CM for pgsql-general@arkaria.postgresql.org; Sun, 01 Apr 2018 00:17:32 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f2Qge-0003J4-0g for pgsql-general@lists.postgresql.org; Sun, 01 Apr 2018 00:17:32 +0000 Received: from n3.nabble.com ([162.255.23.22]) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f2QgW-0002Xw-5z for pgsql-general@postgresql.org; Sun, 01 Apr 2018 00:17:30 +0000 Received: from n3.nabble.com (localhost [127.0.0.1]) by n3.nabble.com (Postfix) with ESMTP id 8335CC0DDB71 for ; Sat, 31 Mar 2018 17:17:22 -0700 (MST) Date: Sat, 31 Mar 2018 17:17:22 -0700 (MST) From: pinker To: pgsql-general@postgresql.org Message-ID: <1522541842492-0.post@n3.nabble.com> In-Reply-To: <650a05f5-2926-5a63-e653-2ae5aa903547@aklaver.com> References: <1522539643653-0.post@n3.nabble.com> <650a05f5-2926-5a63-e653-2ae5aa903547@aklaver.com> Subject: Re: unreliable behaviour of track_functions MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Adrian Klaver-4 wrote > https://www.postgresql.org/docs/10/static/monitoring-stats.html#PG-STAT-USER-FUNCTIONS-VIEW > > "...But if you want to see new results with each query, be sure to do > the queries outside any transaction block. Alternatively, you can invoke > pg_stat_clear_snapshot(), which will discard the current transaction's > statistics snapshot (if any). The next use of statistical information > will cause a new snapshot to be fetched. > > A transaction can also see its own statistics (as yet untransmitted to > the collector) in the views pg_stat_xact_all_tables, > pg_stat_xact_sys_tables, pg_stat_xact_user_tables, and > pg_stat_xact_user_functions. These numbers do not act as stated above; > instead they update continuously throughout the transaction. > > " > Adrian Klaver > adrian.klaver@ Thank you for that, but does this strange behaviour should not be better documented? If somebody (like me, I have some time ago being unaware of this behaviour) wants to build a monitoring system that base on the view pg_stat_user_functions, should not be informed what to expect? -- Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html