Search Postgresql Archives

Re: postmaster slowing down

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux