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 1lHm4d-0005jv-Qk for pgsql-bugs@arkaria.postgresql.org; Thu, 04 Mar 2021 11:23:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lHm4c-0001It-O3 for pgsql-bugs@arkaria.postgresql.org; Thu, 04 Mar 2021 11:23:18 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lHm4c-0001Im-I3 for pgsql-bugs@lists.postgresql.org; Thu, 04 Mar 2021 11:23:18 +0000 Received: from mxh02aws156.mxout.inova.com.br ([34.199.21.156] helo=mxhero02.a.inova.com.br) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lHm4X-00035R-DI for pgsql-bugs@lists.postgresql.org; Thu, 04 Mar 2021 11:23:18 +0000 Received: from localhost (localhost [127.0.0.1]) by mxhero02.a.inova.com.br (Postfix) with ESMTP id 9EECA192833 for ; Thu, 4 Mar 2021 11:23:10 +0000 (UTC) Received: from corpmoutpolicyd01.a.inova.com.br (ip-10-0-1-88.ec2.internal [10.0.1.88]) by mxhero02.a.inova.com.br (Postfix) with ESMTP; Thu, 4 Mar 2021 11:23:10 +0000 (UTC) Received: from corpmoutpolicyd01.a.inova.com.br (localhost [127.0.0.1]) by corpmoutpolicyd01.a.inova.com.br (Postfix) with ESMTP id 90BC62203BF; Thu, 4 Mar 2021 08:23:08 -0300 (BRT) Received: from corpmout01.a.inova.com.br (ip-10-0-1-125.ec2.internal [10.0.1.125]) by corpmoutpolicyd01.a.inova.com.br (Postfix) with ESMTP id 772FEC2A1B; Thu, 4 Mar 2021 08:23:07 -0300 (BRT) Received: from corpmbox02.a.inova.com.br (ip-10-0-4-158.ec2.internal [10.0.4.158]) by corpmout01.a.inova.com.br (Postfix) with ESMTP; Thu, 4 Mar 2021 08:23:07 -0300 (-03) Date: Thu, 4 Mar 2021 08:23:07 -0300 (BRT) From: luis.roberto@siscobra.com.br To: pgsql-bugs Message-ID: <295851993.7384397.1614856987194.JavaMail.zimbra@siscobra.com.br> Subject: Number of Shared Blocks Hit MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [10.0.4.158] X-Mailer: Zimbra 8.8.15_GA_3980 (ZimbraWebClient - GC88 (Win)/8.8.15_GA_3980) Thread-Index: S9A9mv4WtUkXyNl+hAj5/5H4i0iiag== Thread-Topic: Number of Shared Blocks Hit x-mxHero-Origin-Ip: /127.0.0.1:50848 X-mxHero-AttachmentBlock: rule=48;result=false List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, While running a update, and checking EXPLAIN ANALYZE output, I found it strange that in the "ModifyTable" node, it shows "Shared Hit Blocks":351938580. If my math is correct, that amounts to more than 2.5TB. The table itself has only 8GB, and 12 with indices: pg_table_size|pg_total_relation_size| -------------|----------------------| 8316043264| 12471787520| The update statements was: UPDATE inconsistencia SET incondatinc = remincdatcad::timestamp "incondatinc" was a freshly added column with "now()" as default value. Is this value correct? Here's the parsed plan: https://explain.dalibo.com/plan/LTN [ { "Plan": { "Node Type": "ModifyTable", "Operation": "Update", "Parallel Aware": false, "Relation Name": "inconsistencia", "Schema": "public", "Alias": "inconsistencia", "Startup Cost": 0.00, "Total Cost": 821781.08, "Plan Rows": 26132966, "Plan Width": 129, "Actual Startup Time": 235607.729, "Actual Total Time": 235607.730, "Actual Rows": 0, "Actual Loops": 1, "Shared Hit Blocks": 351938580, "Shared Read Blocks": 762606, "Shared Dirtied Blocks": 1565402, "Shared Written Blocks": 774916, "Local Hit Blocks": 0, "Local Read Blocks": 0, "Local Dirtied Blocks": 0, "Local Written Blocks": 0, "Temp Read Blocks": 0, "Temp Written Blocks": 0, "I/O Read Time": 22884.559, "I/O Write Time": 4.956, "Plans": [ { "Node Type": "Seq Scan", "Parent Relationship": "Member", "Parallel Aware": false, "Relation Name": "inconsistencia", "Schema": "public", "Alias": "inconsistencia", "Startup Cost": 0.00, "Total Cost": 821781.08, "Plan Rows": 26132966, "Plan Width": 129, "Actual Startup Time": 0.008, "Actual Total Time": 13767.894, "Actual Rows": 26141470, "Actual Loops": 1, "Output": ["remitemseq", "remincdevnom", "remincnumcon", "inccod", "remincobs", "remincrem", "remincdevcod", "carcod", "remincnumpar", "reminclin", "remincreg", "remincdatcad", "(remincdatcad)::timestamp without time zone", "ctid"], "Shared Hit Blocks": 48185, "Shared Read Blocks": 446934, "Shared Dirtied Blocks": 42, "Shared Written Blocks": 886, "Local Hit Blocks": 0, "Local Read Blocks": 0, "Local Dirtied Blocks": 0, "Local Written Blocks": 0, "Temp Read Blocks": 0, "Temp Written Blocks": 0, "I/O Read Time": 7726.779, "I/O Write Time": 4.956 } ] }, "Planning": { "Shared Hit Blocks": 0, "Shared Read Blocks": 0, "Shared Dirtied Blocks": 0, "Shared Written Blocks": 0, "Local Hit Blocks": 0, "Local Read Blocks": 0, "Local Dirtied Blocks": 0, "Local Written Blocks": 0, "Temp Read Blocks": 0, "Temp Written Blocks": 0, "I/O Read Time": 0.000, "I/O Write Time": 0.000 }, "Planning Time": 0.054, "Triggers": [ ], "Execution Time": 235607.759 } ] Luis R. Weck