Re: pg_xlogdump --stats

From: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
To: Abhijit Menon-Sen <ams(at)2ndQuadrant(dot)com>
Cc: Andres Freund <andres(at)2ndquadrant(dot)com>, Dilip kumar <dilip(dot)kumar(at)huawei(dot)com>, <pgsql-hackers(at)postgresql(dot)org>, <furuyao(at)pm(dot)nttdata(dot)co(dot)jp>
Subject: Re: pg_xlogdump --stats
Date: 2014-09-11 09:14:42
Message-ID: 54116802.8080806@vmware.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 09/11/2014 11:43 AM, Abhijit Menon-Sen wrote:
> At 2014-08-21 10:06:39 +0300, hlinnakangas(at)vmware(dot)com wrote:
>> I think the names that rm_identify returns should match those that the
>> rm_desc functions print.
>
> I had originally started off trying to keep the output in sync, but it
> doesn't work very well. There are rm_desc functions that print things
> like "truncate before" and "Create posting tree", and many decisions
> are quite arbitrary ("freeze_page", "cleanup info", "multi-insert").

It would be good to clean up those messages to be more sensible and
consistent.

> I think it's better the (grep-friendly) way it is. If anything, perhaps
> rm_desc should output "${rm_identify}[: optional explanation]". That
> would also make it very clear what should go in rm_identify and what
> should go in rm_desc.

Yeah, that makes sense too.

>> The corresponding rm_identify output is:
>>
>> HOT_UPDATE+INIT
>
> The +INIT is admittedly a special case, and I would have no objection to
> writing that as (INIT) or something instead.

I don't care much, as long as it's consistent the rm_desc output.

It's quite arbitrary that the INIT cases are considered different record
types, with their own "identity" string, instead of being just a flag in
the same record type. It's an implementation detail that that flag is
stored in the xl_info, and that implementation detail is now exposed in
the stats pg_xlogdump --stats output. There are similar cases in B-tree
splits, for example, where a split where the new tuple goes to the left
half is considered a different record type than one where it goes ot the
right half. It might be interesting to count them separately in the
stats, but then again it might just be confusing. The xl_info flags and
the rm_desc output were never intended to be a useful categorization for
statistics purposes, so it's not surprising that it's not too well
suited for that. Nevertheless, the "pg_xlogdump --stats" is useful as it
is, if you know the limitations.

- Heikki

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Костя Кузнецов 2014-09-11 09:16:12 gist vacuum seaq access
Previous Message Abhijit Menon-Sen 2014-09-11 08:43:16 Re: pg_xlogdump --stats