Re: postmaster slowing down

From: Richard Huxton <dev(at)archonet(dot)com>
To: "surabhi(dot)ahuja" <surabhi(dot)ahuja(at)iiitb(dot)ac(dot)in>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: postmaster slowing down
Date: 2006-11-06 11:38:15
Message-ID: 454F1EA7.3020208@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message surabhi.ahuja 2006-11-06 11:38:57 Re: postmaster slowing down
Previous Message Tomasz Ostrowski 2006-11-06 11:26:43 Re: Dump all databases to corresponding files