From: Murthy Nunna <mnunna@fnal.gov>
To: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
Subject: Query Performance after pg_restore
Date: Sun, 24 Dec 2023 15:53:39 +0000
Message-ID: <DM8PR09MB66777254DC04045815B09196B89AA@DM8PR09MB6677.namprd09.prod.outlook.com> (raw)
Hi,
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.
I ran "analyze verbose ;" on the database, but it did not help. It ran quick in 1.5 hours, but as you are aware it does sampling.
I am now running "vacuumdb -p <port-number> -a -z -j 10 -v", but I do not know if it is going to help.
I am not sure if above vacuumdb helps, but if it helps what is it vacuuming in a pristine database? If it is doing some special "analyze", what is it? Is there a way to run "full" analyze without sampling and without vacuuming?
By the way, there is no change in postgres versions. It is 14.4 before and after pg_restore.
Thanks!
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: mnunna@fnal.gov
Subject: Re: Query Performance after pg_restore
In-Reply-To: <DM8PR09MB66777254DC04045815B09196B89AA@DM8PR09MB6677.namprd09.prod.outlook.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox