Re: REVIEW: Track TRUNCATE via pgstat - Mailing list pgsql-hackers

From Alex Shulgin
Subject Re: REVIEW: Track TRUNCATE via pgstat
Date
Msg-id 87r3vywdyf.fsf@commandprompt.com
Whole thread Raw
In response to Re: REVIEW: Track TRUNCATE via pgstat  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Responses Re: REVIEW: Track TRUNCATE via pgstat  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List pgsql-hackers
Alvaro Herrera <alvherre@2ndquadrant.com> writes:
>
>> Even with the current approach of checking the stats after every
>> isolated case it's sometimes takes quite a little more than a glance
>> to verify correctness due to side-effects of rollback (ins/upd/del
>> counters are still updated), and the way stats are affecting the dead
>> tuples counter.
>
> Honestly I think pg_regress is not the right tool to test stat counter
> updates.  It kind-of works today, but only because we don't stress it
> too much.  If you want to create a new test framework for pgstats, and
> include some tests for truncate, be my guest.

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.

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

--
Alex


Attachment

pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: parallel mode and parallel contexts
Next
From: Rahila Syed
Date:
Subject: Re: [REVIEW] Re: Compression of full-page-writes