Re: Why is restored database faster?

From: Dennis Bjorklund <db(at)zigo(dot)dhs(dot)org>
To: David Shadovitz <david(at)shadovitz(dot)com>
Cc: "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Why is restored database faster?
Date: 2003-12-17 06:42:46
Message-ID: Pine.LNX.4.44.0312170739330.10157-100000@zigo.dhs.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Tue, 16 Dec 2003, David Shadovitz wrote:

> I backed up my database using pg_dump, and then restored it onto a different
> server using psql. I see that the query "SELECT COUNT(*) FROM myTable"
> executes immediately on the new server but takes several seconds on the old
> one. (The servers are identical.)
>
> What could account for this difference? Clustering? How can I get the
> original server to perform as well as the new one?

You probably need to run VACUUM FULL. It locks the tables during its
execution so only do it when the database is not in full use.

If this helps you probably need to do normal vacuums more often and maybe
tune the max_fsm_pages to be bigger.

--
/Dennis

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Richard Huxton 2003-12-17 09:52:15 Re: Nested loop question
Previous Message Shridhar Daithankar 2003-12-17 06:31:06 Re: Why is restored database faster?