Skip site navigation (1) Skip section navigation (2)

VACUUM ANALYZE

From: David Anthony <DavidA(at)tradeworld(dot)net>
To: pgsql-novice(at)postgresql(dot)org
Subject: VACUUM ANALYZE
Date: 2002-01-14 14:25:12
Message-ID: 8427C66A66C9D511B4B80090271B275D3B13E6@mail.inet.co.za (view raw or flat)
Thread:
Lists: pgsql-novice
Hi

I have a postgresql database with about 5 tables. On a nightly basis, all
the records in all 5 tables are deleted and repopulated with fresh data.
Some of the tables have between 30 000 and 80 000 records. I have been
looking through the docs to try and work out how best to optimize the
database as I have noticed a definite lag in response as the database grows.

1. I have placed indexes on the columns that are used in searching 
2. when deleting all the records from a table I use TRUNCATE instead of
DELETE 
3. the repopulation occurs via a perl script and at the end of the script I
run VACUUM ANALYZE on the database.

Any other things I should look at? Also, is there a way to check when the
last time VACUUM ANALYZE was run on the db. I am unsure whether the perl
script is running the command successfully.

Thanks
Dave

Responses

pgsql-novice by date

Next:From: RobDate: 2002-01-14 14:52:13
Subject: Store procedures
Previous:From: Jules AlbertsDate: 2002-01-14 14:20:06
Subject: inheritance and audit columns

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group