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 1f0w75-0006tk-Nh for pgsql-committers@arkaria.postgresql.org; Tue, 27 Mar 2018 21:26:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f0w74-00026B-CO for pgsql-committers@arkaria.postgresql.org; Tue, 27 Mar 2018 21:26:38 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f0w74-000261-7e for pgsql-committers@lists.postgresql.org; Tue, 27 Mar 2018 21:26:38 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f0w71-0007oR-1X for pgsql-committers@lists.postgresql.org; Tue, 27 Mar 2018 21:26:37 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w2RLQQFs031022; Tue, 27 Mar 2018 17:26:26 -0400 From: Tom Lane To: Simon Riggs cc: pgsql-committers@lists.postgresql.org, Konstantin Knizhnik Subject: Re: pgsql: Allow HOT updates for some expression indexes In-reply-to: <11787.1522184835@sss.pgh.pa.us> References: <11787.1522184835@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Tue, 27 Mar 2018 17:07:15 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <31020.1522185986.1@sss.pgh.pa.us> Date: Tue, 27 Mar 2018 17:26:26 -0400 Message-ID: <31021.1522185986@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk I wrote: > The test script appears to imagine that pgstats outputs update > instantaneously. Oh, wait, it's looking at pg_stat_xact, which is the *local*, unsent stats information. So your problem is actually the reverse of that: if the test runs too slowly, it fails, because at some point the unsent stats information will get flushed out to the collector and disappear from the pg_stat_xact view. You could probably make this more reliable by wrapping each test stanza in a transaction, ie instead of create table keyvalue ...; ... do something to table ... select pg_stat_get_xact_tuples_hot_updated('keyvalue'::regclass); drop table keyvalue; do begin; create table keyvalue ...; ... do something to table ... select pg_stat_get_xact_tuples_hot_updated('keyvalue'::regclass); rollback; (no need for a DROP if you're rolling it all back) regards, tom lane