Packages
Ecto PostgreSQL database performance insights. Locks, index usage, buffer cache hit ratios, vacuum stats and more.
Current section
Files
Jump to
Current section
Files
lib/queries/records_rank.ex
defmodule EctoPSQLExtras.RecordsRank do
def title do
"All tables and the number of rows in each ordered by number of rows descending"
end
def query do
"""
/* All tables and the number of rows in each ordered by number of rows descending */
SELECT
relname AS name,
n_live_tup AS estimated_count
FROM
pg_stat_user_tables
ORDER BY
n_live_tup DESC;
"""
end
end