Re: pg_stat_transaction patch

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Itagaki Takahiro <itagaki(dot)takahiro(at)gmail(dot)com>
Cc: Joel Jacobson <joel(at)gluefinance(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_stat_transaction patch
Date: 2010-08-07 19:50:15
Message-ID: 16899.1281210615@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Itagaki Takahiro <itagaki(dot)takahiro(at)gmail(dot)com> writes:
> "Accessor functions to get so far collected statistics for the current
> transaction"
> https://commitfest.postgresql.org/action/patch_view?id=301

> The latest version of the patch works as expected, and also well-formed.
> I'll mark the patch to "Ready for Committer".

I'm working through this patch now. I kind of think that we ought to
drop the functions and view columns that claim to report live/dead
tuples. In the first place, they're misnamed, because what they're
actually reporting is delta values (ie, new live tuples or new dead
tuples). In the second place, they don't seem very useful. The
live_tuples count is absolutely, positively guaranteed to read out as
zero, because a transaction that hasn't reached commit cannot have
created any known-live tuples. The dead_tuples count can read out as
positive under certain circumstances, for example if a subtransaction
inserted some tuples and was then rolled back --- we know for certain
those tuples are dead and so the t_delta_dead_tuples count gets
incremented at subtransaction rollback. But for the most part the
dead_tuples count is going to be a lot less than people might expect
based on what the transaction's done so far.

If we keep these we're going to have to document them a lot better
than the submitted patch does. But I think we should just take 'em out.
Comments?

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Gordon Shannon 2010-08-07 23:11:21 Re: Surprising dead_tuple_count from pgstattuple
Previous Message Marc G. Fournier 2010-08-07 18:36:04 Re: Moderator on Committers?