Is this extra complexity worth one saved GetCurrentTimestamp()?
I'm not sure really. But I really need a new column in one way or
another, so I can agree to whatever decision we'll make.
src/backend/access/transam/xact.c is calling GetCurrentTimestamp a
lot already, so I don't really buy the argument it should be avoided
at all cost in pg_stat_statements. Just storing the statement end time
would make this use case much nicer.
+1
Maybe just move GetCurrentTimestamp outside of spin lock is engouh
already?
Christoph