2013/5/14 Fabrízio de Royes Mello <[email protected]>

>
> 2013/5/14 Francisco Porfirio <[email protected]>
>
>> --Tamanho dos databases
>> SELECT datname, pg_size_pretty(pg_database_size(datname))
>> FROM pg_database;
>>
>
> Ok
>
>
> --Tamanho de todas as tabelas.
>> SELECT relname as "Table",
>>        pg_size_pretty(pg_total_relation_size(relid)) As "Size",
>>        pg_size_pretty(pg_total_relation_size(relid) -
>> pg_relation_size(relid)) as "External Size"
>>   FROM pg_catalog.pg_statio_user_tables ORDER BY
>> pg_total_relation_size(relid) DESC;
>>
>
>
> Aqui vc está verificando apenas tabelas regulares, ou seja, NÃO está
> considerando o catálogo... tente trocar "pg_statio_user_tables" por
> "pg_stat_all_tables".
>
> Att,
>
> --
> Fabrízio de Royes Mello
> Consultoria/Coaching PostgreSQL
> >> Blog sobre TI: http://fabriziomello.blogspot.com
> >> Perfil Linkedin: http://br.linkedin.com/in/fabriziomello
> >> Twitter: http://twitter.com/fabriziomello
>
> _______________________________________________
> pgbr-geral mailing list
> [email protected]
> https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral
>
>
boa tarde
utilizo esse comando abaix, mas somente para as tabelas:

SELECT esquema, tabela,
       pg_size_pretty(pg_relation_size(esq_tab)) AS tamanho,
       pg_size_pretty(pg_total_relation_size(esq_tab)) AS tamanho_total
  FROM (SELECT tablename AS tabela,
               schemaname AS esquema,
               schemaname||'.'||tablename AS esq_tab
          FROM pg_catalog.pg_tables
         WHERE schemaname NOT
            IN ('pg_catalog', 'information_schema', 'pg_toast') ) AS x
 ORDER BY pg_total_relation_size(esq_tab) DESC;

-- 

Douglas Fabiano Specht
_______________________________________________
pgbr-geral mailing list
[email protected]
https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral

Responder a