Re: Query Performance after pg_restore

Поиск
Список
Период
Сортировка
От Laurenz Albe
Тема Re: Query Performance after pg_restore
Дата
Msg-id ab3ef39fa330b2ea4aabbf7b768c22b9268f793b.camel@cybertec.at
обсуждение исходный текст
Ответ на Query Performance after pg_restore  (Murthy Nunna <mnunna@fnal.gov>)
Ответы RE: Query Performance after pg_restore  (Murthy Nunna <mnunna@fnal.gov>)
Список pgsql-admin
On Sun, 2023-12-24 at 15:53 +0000, Murthy Nunna wrote:
> I did pg_dump of a ~20TB database followed by pg_restore. I find simple queries like select
> count(*) running slow. I did a select count(*) on all tables before pg_dump which took ~4 hours.
> After pg_restore, same thing took 32 hours.

SELECT count(*) is always slow.

> By the way, there is no change in postgres versions. It is 14.4 before and after pg_restore.

You should compare the execution plans of the queries on the old and the new server.

Besides, if you are running lots of count(*) queries, you are doing something wrong:
https://www.cybertec-postgresql.com/en/pagination-problem-total-result-count/#total-count

Yours,
Laurenz Albe



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

Предыдущее
От: Ron Johnson
Дата:
Сообщение: Re: Query Performance after pg_restore
Следующее
От: Murthy Nunna
Дата:
Сообщение: RE: Query Performance after pg_restore