Complete the code to select the query text from pg_stat_statements.
SELECT [1] FROM pg_stat_statements;The query column contains the text of the SQL statements tracked by pg_stat_statements.
Complete the code to order queries by total execution time descending.
SELECT query, total_time FROM pg_stat_statements ORDER BY [1] DESC;Ordering by total_time descending shows the slowest queries first by total time spent.
Fix the error in the code to filter queries with total_time greater than 1000 ms.
SELECT query, total_time FROM pg_stat_statements WHERE total_time [1] 1000;
To find slow queries, filter where total_time is greater than 1000 milliseconds.
Fill both blanks to select query and calls where calls are more than 50 and order by calls descending.
SELECT [1], calls FROM pg_stat_statements WHERE calls [2] 50 ORDER BY calls DESC;
Select query and filter where calls is greater than 50 to find frequently run queries, then order by calls descending.
Fill all three blanks to select query, calls, and mean_time for queries with mean_time over 200 ms, ordered by mean_time descending.
SELECT [1], [2], mean_time FROM pg_stat_statements WHERE mean_time [3] 200 ORDER BY mean_time DESC;
Select query and calls, filter where mean_time is greater than 200 ms, and order by mean_time descending to find slow queries by average time.