postgresq table 件数
https://gist.github.com/smd877/3877864
select relname
, n_live_tup
from pg_stat_user_tables w
here schemaname='public';
SELECT T2.relname
, T2.reltuples
FROM pg_stat_user_tables AS T1
INNER JOIN pg_class AS T2
ON T1.relname = T2.relname
ORDER BY T2.relname;
SELECT relname, n_tup_ins - n_tup_del as rowcount
FROM pg_stat_all_tables
select relname, n_live_tup
from pg_stat_user_tables
where schemaname='public';