Removal of unnecessary CommandCounterIncrement() when doing ON COMMIT DELETE ROWS

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Postgres hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Removal of unnecessary CommandCounterIncrement() when doing ON COMMIT DELETE ROWS
Date: 2018-11-09 02:47:31
Message-ID: 20181109024731.GF2652@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi all,

When doing a set of ON COMMIT DELETE ROWS actions for relations, there
is a CCI happening after each truncation:
@@ -13334,10 +13334,8 @@ PreCommit_on_commit_actions(void)
* exists at truncation time.
*/
if (oids_to_truncate != NIL)
- {
heap_truncate(oids_to_truncate);
- CommandCounterIncrement(); /* XXX needed? */
- }

This has been visibly introduced by f9b5b41 back in 2002 which reworked
how ON COMMIT works.

Alvaro has mentioned that it would not be needed here:
20181106125337(dot)o23kjdv546bu2tei(at)alvherre(dot)pgsql
And I think that I agree with that, because visibly this applies to
index rebuilds but in those cases CCIs are happening locally. So I
think that we can get rid of that, and I suggest to remove it only on
HEAD only of course.

Any objections?
--
Michael

Attachment Content-Type Size
oncommit-cci-remove.patch text/x-diff 508 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2018-11-09 03:11:48 Re: New function pg_stat_statements_reset_query() to reset statistics of a specific query
Previous Message David Rowley 2018-11-09 02:19:38 Re: Performance improvements of INSERTs to a partitioned table