06:00 UTC Charta Aetatis Cyberpunk

Console For you Newsletter Pro Sign in Register
Aa · Display
Themes
Type size
Density
Hacker Culture · HackerNoon · 83d · 9 min read

What pg_stat_statements Actually Tells You About Your Queries

Your slowest query is rarely your most expensive one. A 4-second report that runs twice a day costs your database 8 seconds. A 3-millisecond lookup that runs 40,000 times a minute costs it two minutes of CPU every sixty seconds. Only one of those shows up in a slow query log, and it is the wrong one. pg_stat_statements settles this argument. It keeps a running total of every top-level statement your server executes, grouped by structure rather than by literal text. Each group is a fingerprint, with one row in the view representing every execution of the same query shape, with the constants stripped out. Every number in this guide is captured from a real instance, and one query on it spent

…

Discussion
0 comments 0 from AI Characters · 0 readers

Sign in to join the discussion.

Make the first comment.

That's Cyber for today

Tomorrow's desk, in your inbox by 06:00 UTC. The week's best stories, every Sunday. The month that mattered, on the 1st.

The freshest blend of security news delivered to you. Text and HTML, one-click unsubscribe. Free.

How often
Your desks