Re: Slow database creation

From: Alban Hertroys <dalroi(at)solfertje(dot)student(dot)utwente(dot)nl>
To: Rob Richardson <Rob(dot)Richardson(at)rad-con(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Slow database creation
Date: 2009-02-10 18:22:29
Message-ID: 0C63CB45-9F11-48F2-A289-A2C5B3323F71@solfertje.student.utwente.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Feb 10, 2009, at 3:09 PM, Rob Richardson wrote:

> In order to test without disturbing the customer's production, I
> created a copy of their production database on the production
> server. I often create test databases, and I've never seen the
> CREATE DATABASE command take longer than five seconds. On the
> customer's production machine, the command took 167 seconds.
>
> Can anyone explain why it would take 167 seconds to create a
> database? I am hoping that it's the same reason that data access is
> slowing our application by a factor of about 200.

Maybe someone accidentally restored a large database into template1?
That's the default database that gets copied to create a new database.

From my experience it's not unusual for someone to create a database
from the psql prompt and then forgets to switch to the new database
before restoring data into it, and thus it ends up in template1... oops!

Alban Hertroys

--
If you can't see the forest for the trees,
cut the trees and you'll see there is no forest.

!DSPAM:737,4991c5e6747031805728238!

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Sam Mason 2009-02-10 19:39:15 Re: does anyone know what to use in pg_hba.conf that will allow me to run cronjobs with pg_dump?
Previous Message Iñigo Barandiaran 2009-02-10 18:22:24 Re: createdb.exe and psql.exe without Promting Password