Laurenz Albe offers up some thoughts:
Sometimes one of our customers looks at the most time consuming statements in a database (either with
pg_stat_statementsor with pgBadger) and findsCOMMITin the high ranks. Normally,COMMITis a very fast statement in PostgreSQL, so that is worth investigating. In this article, I will explore the possible reasons for a slowCOMMITand discuss what you can do about it.
Read on for those reasons.