Re: postmaster slowing down - Mailing list pgsql-general

From Richard Huxton
Subject Re: postmaster slowing down
Date
Msg-id 454F1EA7.3020208@archonet.com
Whole thread Raw
In response to Re: postmaster slowing down  ("surabhi.ahuja" <surabhi.ahuja@iiitb.ac.in>)
List pgsql-general
surabhi.ahuja wrote:
> Answer to Question 1:
>
> I forgot to mention this: before i start running this program (refer
> to the mail below) I clean up (rm -rf) and create the data directory
> (PGDATA, by doing initdb) then i create the 4 tables (stored
> procedures etc)
>
> and then run the program Please see that I am not doing any deletes
> its just the inserts going on. I guess I wont have to do a vacuum? Am
> i right.

You need vacuum for deletes or updates, but not inserts.

> I am not doing analyze currently, how frequently should I be doing
> it, I mean what factors should I consider to decide how frequently I
> should do it.

The short answer - analyse often enough to avoid slow down. Crucially,
PG will need to know how many rows are in each table and the
distribution of values to decide whether to use indexes.

Start by adding an analyse at the half-way point of your inserts. That
should make a noticeable difference. Now try at the 25% points etc. Read
the manuals for vacuum and analyse details.

There is the autovacuum tool, which iirc is bundled with 8.0 but not
turned on. You might want to enable it.

> Answer to Question 2:
>
> the program do not take any input . When its slow how do i know if
> the cpu is slow or not? (sorry i am asking again)

Read up on top, vmstat and iostat - these are the basic tools you'll
need to monitor your server.

--
   Richard Huxton
   Archonet Ltd

pgsql-general by date:

Previous
From: "surabhi.ahuja"
Date:
Subject: Re: postmaster slowing down
Next
From: Desmond Coughlan
Date:
Subject: first steps in PhP and PostgreSQL