Re: pgsql: Allow HOT updates for some expression indexes - Mailing list pgsql-committers

From Tom Lane
Subject Re: pgsql: Allow HOT updates for some expression indexes
Date
Msg-id 31021.1522185986@sss.pgh.pa.us
Whole thread Raw
In response to Re: pgsql: Allow HOT updates for some expression indexes  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: pgsql: Allow HOT updates for some expression indexes
List pgsql-committers
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


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: Re: pgsql: Allow HOT updates for some expression indexes
Next
From: Tom Lane
Date:
Subject: pgsql: Update pgindent's typedefs blacklist,and make it easier to adju