Pg stat user tables

From wikieduonline
Revision as of 17:15, 25 August 2021 by Chmod14 (talk | contribs)
Jump to navigation Jump to search
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;


PostgreSQL VACUUM

SELECT
  schemaname, relname,
  last_vacuum, last_autovacuum,
  vacuum_count, autovacuum_count
FROM pg_stat_user_tables;


Related terms


See also

Advertising: