Update July 24, 2023
Some major stored procedure SQL problems were overlooked until 2 days ago. I submitted revised statements to fix a massive write operation on every single post and comment creation on a local site. The site_aggregates table... every row modified instead of a single row. https://github.com/LemmyNet/lemmy/pull/3704
I was curious why pg_stat_statements didn't draw more attention to the INSERT statements hitting so many rows, and I found out that by default it does not take into account stored procedure execution! https://stackoverflow.com/questions/56741860/pg-stat-activity-how-to-see-current-activity-inside-a-running-stored-procedure
pg_stat_statements.track = all
Now I'm seeing far more activity than I have been looking at for the past 2 months... the stored procedure statements are showing up!
Install steps: https://gist.github.com/rcanepa/535163dc249539912c25