pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Simon Riggs <simon@2ndquadrant.com>
Cc: pgsql-committers@lists.postgresql.org, Konstantin Knizhnik <k.knizhnik@postgrespro.ru>
Subject: Re: pgsql: Allow HOT updates for some expression indexes
Date: Tue, 27 Mar 2018 17:26:26 -0400
Message-ID: <31021.1522185986@sss.pgh.pa.us> (raw)
In-Reply-To: <11787.1522184835@sss.pgh.pa.us>
References: <E1f0tqf-0007Vs-JZ@gemulon.postgresql.org>
	<CANP8+jLd4USe=yuN77NVQOyijO9Wn4DFNt+iLr74sBVuCSBnsQ@mail.gmail.com>
	<CANP8+jKLMvyHqy7PTn-HBEvSh3-dH+OOEiwJJYV2XMkF2UshtQ@mail.gmail.com>
	<11787.1522184835@sss.pgh.pa.us>

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




view thread (7+ messages)  latest in thread

Message-ID: <31021.1522185986@sss.pgh.pa.us>
Permalink:  ../31021.1522185986@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/31021.1522185986@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, simon@2ndquadrant.com, k.knizhnik@postgrespro.ru
  Subject: Re: pgsql: Allow HOT updates for some expression indexes
  In-Reply-To: <31021.1522185986@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox