Re: Query Performance after pg_restore - Mailing list pgsql-admin

From Laurenz Albe
Subject Re: Query Performance after pg_restore
Date
Msg-id ab3ef39fa330b2ea4aabbf7b768c22b9268f793b.camel@cybertec.at
Whole thread Raw
In response to Query Performance after pg_restore  (Murthy Nunna <mnunna@fnal.gov>)
Responses RE: Query Performance after pg_restore
List 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 by date:

Previous
From: Ron Johnson
Date:
Subject: Re: Query Performance after pg_restore
Next
From: Murthy Nunna
Date:
Subject: RE: Query Performance after pg_restore