pg_stat_statements vs. SELECT FOR UPDATE

Andrew Gierth <andrew@tao11.riddles.org.uk>

From: Andrew Gierth <andrew@tao11.riddles.org.uk>
To: pgsql-hackers@lists.postgresql.org
Date: 2019-01-19T14:43:10Z
Lists: pgsql-hackers

Attachments

pg_stat_statements considers a plain select and a select for update to
be equivalent, which seems quite wrong to me as they will have very
different performance characteristics due to locking.

The only comment about it in the code is:

    /* we ignore rowMarks */

I propose that it should not ignore rowMarks, per the attached patch or
something similar.

(thanks to Vik Fearing for preliminary testing)

-- 
Andrew (irc:RhodiumToad)

Commits

  1. Teach pg_stat_statements not to ignore FOR UPDATE clauses