Re: REVIEW: Track TRUNCATE via pgstat

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Alex Shulgin <ash(at)commandprompt(dot)com>
Cc: Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: REVIEW: Track TRUNCATE via pgstat
Date: 2014-12-17 14:55:22
Message-ID: 20141217145522.GD1768@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Alex Shulgin wrote:

> OK, I think I have now all bases covered, though the updated patch is
> not that "pretty".
>
> The problem is that we don't know in advance if the (sub)transaction is
> going to succeed or abort, and in case of aborted truncate we need to
> use the stats gathered prior to truncate. Thus the need to track
> insert/update/deletes that happened before first truncate separately.

Ugh, this is messy indeed. I grant that TRUNCATE is a tricky case to
handle correctly, so some complexity is expected. Can you please
explain in detail how this works?

> To the point of making a dedicated pgstat testing tool: let's have
> another TODO item?

Sure.

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2014-12-17 15:23:04 Re: [alvherre@2ndquadrant.com: Re: no test programs in contrib]
Previous Message Simon Riggs 2014-12-17 14:41:39 Re: Reducing lock strength of adding foreign keys