Skip to content

Instantly share code, notes, and snippets.

View mchristofides's full-sized avatar
💛

Michael Christofides mchristofides

💛
View GitHub Profile

Keybase proof

I hereby claim:

  • I am mchristofides on github.
  • I am michristofides (https://keybase.io/michristofides) on keybase.
  • I have a public key ASCQVFNVuaeLI_PoHvJvJEt1tIOsjIsv9-nVEqst2IAXsAo

To claim this, I am signing this object:

@mchristofides
mchristofides / top_50_by_blocks.sql
Created January 26, 2023 18:23
Top 50 queries by total blocks (buffers)
SELECT shared_blks_hit + shared_blks_read + shared_blks_dirtied + shared_blks_written + local_blks_hit + local_blks_read + local_blks_dirtied + local_blks_written + temp_blks_read + temp_blks_written as total_blocks
,(total_exec_time + total_plan_time)::int as total_time
,calls
,query
FROM pg_stat_statements
ORDER BY 1 DESC
LIMIT 50;