Re: database speed

From: Doug McNaught <doug(at)mcnaught(dot)org>
To: "Chris Stokes" <ChrisS(at)basssoftware(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: database speed
Date: 2003-10-31 01:06:25
Message-ID: m3y8v2md0u.fsf@varsoon.wireboard.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Chris Stokes" <ChrisS(at)basssoftware(dot)com> writes:

> WE currently use PG for the local database on our POS workstations
> in shops. Data is then extracted and sent back to head office. Also
> product updates etc are regularly sent to the shops. I have noticed
> over time that the shop PG databases get slower and slower. If I do
> a pg_dump, recreate the database and then restore the data - all
> speed problems are gone and the database folder shrinks in size
> substantially.
>
> >From this information could anyone tell me what are the likely
> >causes and what we may or may not be doing in our extractions and
> >updates that are not good PG insert, update, delete procedures

You should periodically be doing:

a) VACUUM (at least once a day, probably) and
b) REINDEX

Are you doing both of these? See the docs if you're not familiar with
them.

The REINDEX is needed because VACUUM doesn't free up index space in
some circumstances. 7.4 (currently in late beta) will fix this.

-Doug

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Chris Stokes 2003-10-31 01:11:12 Re: database speed
Previous Message David Busby 2003-10-31 01:05:23 Best Perl Option?