Re: Copy of DB behaves different from original

From: Steve Crawford <scrawford(at)pinpointresearch(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: Copy of DB behaves different from original
Date: 2004-09-01 21:42:09
Message-ID: 200409011442.09033.scrawford@pinpointresearch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Wednesday 01 September 2004 1:59 pm, jason(at)soundconcept(dot)net wrote:
> Hi all,
>
> I have a database that I made a copy of (useing pg_dump) to test a
> new program on. The program runs just fine on the new(copy)
> database. However, when I switched my program to run on my
> old(original) database it runs around 10 times slower and takes up
> way more processor power. I tried vacuumdb on the old database and
> it made no difference. Any idea what my problem might be? I could
> just drop and restore the old database, but I would really like to
> understand what might be going on so I could watch for it in the
> future and hopefully prevent it from happening again.
>
> Any information is greatly appreciated.

If the original database isn't live then try a vacuum full on the old
database and be sure to analyze it as well (vacuumdb --full
--analyze). The standard vacuum does not physically shrink the
database files - it just makes no longer used space within the file
available for reuse. The --analyze will update the statistics the
planner uses when deciding how to approach the query (mainly use of
indexes).

If that doesn't do the trick, try reindexing the tables.

Cheers,
Steve

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message derrick 2004-09-02 01:16:11 plpgsql function Syntax
Previous Message jason 2004-09-01 20:59:07 Copy of DB behaves different from original