Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ljeCh-0007v7-IL for pgsql-docs@arkaria.postgresql.org; Thu, 20 May 2021 08:38:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ljeCg-0006tg-Fv for pgsql-docs@arkaria.postgresql.org; Thu, 20 May 2021 08:38:50 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ljeCg-0006tY-A4 for pgsql-docs@lists.postgresql.org; Thu, 20 May 2021 08:38:50 +0000 Received: from oss.nttdata.com ([49.212.34.109]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ljeCd-0008BV-El for pgsql-docs@lists.postgresql.org; Thu, 20 May 2021 08:38:49 +0000 Received: from [192.168.0.6] (124-144-135-173.rev.home.ne.jp [124.144.135.173]) by oss.nttdata.com (Postfix) with ESMTPSA id 32B9760416; Thu, 20 May 2021 17:38:45 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.2 at oss.nttdata.com Subject: Re: more detailed description of tup_returned and tup_fetched To: Fujii Masao , pgsql-docs@lists.postgresql.org References: <9eeeccdb-5dd7-90f9-2807-a4b5d2b76ca3@oss.nttdata.com> <19f98fd2-c81b-f77f-d940-2816c565f850@oss.nttdata.com> <03d26cbe-cce3-5cdf-89e6-df3769ff7728@oss.nttdata.com> <14c6b74b-bb73-f8eb-3ce7-3e903e651bd3@oss.nttdata.com> <733bdf4a-e888-41df-0437-6dfb922d4883@oss.nttdata.com> <4a7fe815-7d79-aff9-19d8-ede4d0f1c10d@oss.nttdata.com> From: Masahiro Ikeda Message-ID: Date: Thu, 20 May 2021 17:38:44 +0900 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <4a7fe815-7d79-aff9-19d8-ede4d0f1c10d@oss.nttdata.com> Content-Type: multipart/mixed; boundary="------------EC94E5F5C703F894E8B08D7C" Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------EC94E5F5C703F894E8B08D7C Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit On 2021/05/20 17:00, Fujii Masao wrote: > On 2021/05/20 9:46, Masahiro Ikeda wrote: >> On 2021/05/18 20:10, Fujii Masao wrote: >>>>> pg_stat_database.tup_fetched: >>>>> Number of index entries returned by scans on indexes in this database >>>> Is this the sum of pg_stat_all_indexes.idx_tup_read? This is accounted to >>>> pg_stat_database.tup_returned. >>> >>> I was thinking that pg_stat_database.tup_fetched is the same as >>> the sum of pg_stat_all_tables.idx_tup_fetch. Because they both >>> are incremented by bitmap index scans, but pg_stat_all_indexes.idx_tup_read >>> is not. >> >> Yes. So, "Number of index entries returned by scans on indexes in this >> database" is incorrect, and "Number of live rows fetched by index scans in >> this database" is correct? > > Yes, I think so! Thanks! I updated the patch for summarizing this thread. Regards, -- Masahiro Ikeda NTT DATA CORPORATION --------------EC94E5F5C703F894E8B08D7C Content-Type: text/x-patch; charset=UTF-8; name="v1-0002-add-more-detailed-description-of-tup_returned-and-tup_fetched.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="v1-0002-add-more-detailed-description-of-tup_returned-and-tu"; filename*1="p_fetched.patch" diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml index dcbb10fb6f..09a22a43ac 100644 --- a/doc/src/sgml/monitoring.sgml +++ b/doc/src/sgml/monitoring.sgml @@ -3712,7 +3712,7 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i tup_returned bigint - Number of rows returned by queries in this database + Number of live rows fetched by sequential scans and index entries returned by index scans in this database @@ -3721,7 +3721,7 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i tup_fetched bigint - Number of rows fetched by queries in this database + Number of live rows fetched by index scans in this database --------------EC94E5F5C703F894E8B08D7C--