Re: slow "select count(*) from information_schema.tables;" in some cases

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: slow "select count(*) from information_schema.tables;" in some cases
Дата
Msg-id 1016661.1644260570@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: slow "select count(*) from information_schema.tables;" in some cases  (Lars Aksel Opsahl <Lars.Opsahl@nibio.no>)
Ответы Re: slow "select count(*) from information_schema.tables;" in some cases  (Lars Aksel Opsahl <Lars.Opsahl@nibio.no>)
Список pgsql-performance
Lars Aksel Opsahl <Lars.Opsahl@nibio.no> writes:
>> SELECT relname, pg_size_pretty(pg_relation_size(C.oid)) FROM pg_class C LEFT JOIN pg_namespace N ON (N.oid =
C.relnamespace)WHERE nspname = 'pg_catalog' ORDER BY 2 DESC LIMIT 20; can you show the output of this query 

"ORDER BY 2" is giving you a textual sort of the sizes, which is entirely
unhelpful.  Try

SELECT relname, pg_size_pretty(pg_relation_size(C.oid)) FROM pg_class C LEFT JOIN pg_namespace N ON (N.oid =
C.relnamespace)WHERE nspname = 'pg_catalog' ORDER BY pg_relation_size(C.oid) DESC LIMIT 20; 

            regards, tom lane



В списке pgsql-performance по дате отправления:

Предыдущее
От: Lars Aksel Opsahl
Дата:
Сообщение: Re: slow "select count(*) from information_schema.tables;" in some cases
Следующее
От: Lars Aksel Opsahl
Дата:
Сообщение: Re: slow "select count(*) from information_schema.tables;" in some cases