Difference between revisions of "Pg stat user tables"

From wikieduonline
Jump to navigation Jump to search
(Created page with "<pre> SELECT relname, 100 * idx_scan / (seq_scan + idx_scan) percent_of_times_index_used, n_live_tup rows_in_table FROM pg_stat_user_tables WHERE seq_scan + i...")
 
Line 12: Line 12:
  
 
</pre>
 
</pre>
 +
 +
[[pg_statio_user_tables]]
  
 
== See also ==
 
== See also ==
 
* {{SQL}}
 
* {{SQL}}
 
* {{PostgreSQL}}
 
* {{PostgreSQL}}

Revision as of 09:38, 5 August 2021

SELECT 
  relname, 
  100 * idx_scan / (seq_scan + idx_scan) percent_of_times_index_used, 
  n_live_tup rows_in_table
FROM 
  pg_stat_user_tables
WHERE 
    seq_scan + idx_scan > 0 
ORDER BY 
  n_live_tup DESC;

pg_statio_user_tables

See also

Advertising: