Databases · Middle · Question 15 of 75
How do you find the queries that consume the most total time in production?
- ✓Correct answer: Use the
pg_stat_statementsextension, which aggregates execution counts and times per normalized query - 2Run
EXPLAINon every query in the codebase - 3Read the PostgreSQL configuration file
Explanation
A query taking 5 ms but running a million times a day can matter more than one slow report. Sort by total time, then optimize the top entries.