Complete the code to select all columns from the pg_stat_user_indexes view.
SELECT [1] FROM pg_stat_user_indexes;The * symbol selects all columns from the table or view.
Complete the code to filter index usage statistics for the table named 'employees'.
SELECT * FROM pg_stat_user_indexes WHERE relname = [1];Table names in SQL strings must be enclosed in single quotes.
Fix the error in the code to correctly count index scans for all user indexes.
SELECT indexrelname, [1] FROM pg_stat_user_indexes;The idx_scan column already contains the count of index scans, so no aggregation is needed.
Fill both blanks to select index names and their scan counts, filtering for indexes with more than 100 scans.
SELECT [1], [2] FROM pg_stat_user_indexes WHERE idx_scan > 100;
indexrelname is the index name, and idx_scan is the number of times the index was scanned.
Fill all three blanks to select index names, table names, and scan counts for indexes scanned more than 50 times in the 'public' schema.
SELECT [1], [2], [3] FROM pg_stat_user_indexes WHERE idx_scan > 50 AND schemaname = 'public';
This query shows the index name (indexrelname), the table name (relname), and the number of scans (idx_scan) for indexes in the 'public' schema scanned more than 50 times.