Liam Slusser wrote:
I've been trying to replicate a database but each time I replication it the performance of the copy is about 100 times slower (~100ms to ~8 seconds for the same query). The only way I have found to replicate it and keep the same performance is doing a hotcopy of the database. Please note I didn't design this database, I just have to support it. $ uname -a Linux hostname 2.6.20-gentoo-r8-5 #2 SMP Wed Aug 1 19:43:33 CDT 2007 x86_64 Intel(R) Xeon(R) CPU 5130 @ 2.00GHz GenuineIntel GNU/Linux $ psql --version psql (PostgreSQL) 8.1.5 So the original database, cmpub, works great. But when I do a pg_dump and import it to a test database on the same server, or another server for that matter, the performance is awful. Here is how I did the test.... Create test database: $ ./createdb --template template1 --encoding UNICODE liam $ ./pg_dump cmpub | ./psql liam Run a vacuum full: liam=# vacuum full verbose;
You need to analyze, not vacuum full. pg_dump doesn't include any analyze statements, you need to do that manually.
-- Postgresql & php tutorials http://www.designmagick.com/ ---------------------------(end of broadcast)--------------------------- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match