Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 6272C9FB912; Thu, 26 Apr 2007 16:49:38 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 80594-04; Thu, 26 Apr 2007 16:49:29 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from polaris.pinpointresearch.com (66-7-238-130.static-ip.telepacific.net [66.7.238.130]) by postgresql.org (Postfix) with ESMTP id 3EC709FB8ED; Thu, 26 Apr 2007 16:49:29 -0300 (ADT) Received: from [192.168.1.179] (betelgeuse.pinpointresearch.com [192.168.1.179]) by polaris.pinpointresearch.com (Postfix) with ESMTP id C2492E0103A2; Thu, 26 Apr 2007 12:49:27 -0700 (PDT) Message-ID: <46310247.2050802@pinpointresearch.com> Date: Thu, 26 Apr 2007 12:49:27 -0700 From: Steve Crawford User-Agent: Thunderbird 1.5.0.10 (X11/20060911) MIME-Version: 1.0 To: Shohab Abdullah CC: pgsql-performance@postgresql.org, majordomo-owner@postgresql.org, Vaishali Mane Subject: Re: [GENERAL] PostgreSQL Performance Tuning References: In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200704/440 X-Sequence-Number: 24317 Shohab Abdullah wrote: > > Dear, > We are facing performance tuning problem while using PostgreSQL Database > over the network on a linux OS. > Our Database consists of more than 500 tables with an average of 10K > records per table with an average of 20 users accessing the database > simultaneously over the network. Each table has indexes and we are > querying the database using Hibernate. > The biggest problem is while insertion, updating and fetching of > records, ie the database performance is very slow. It take a long time > to respond in the above scenario. > Please provide me with the tuning of the database. I am attaching my > *postgresql.conf* file for the reference of our current configuration Have you changed _anything_ from the defaults? The defaults are set so PG will run on as many installations as practical. They are not set for performance - that is specific to your equipment, your data, and how you need to handle the data. Assuming the record sizes aren't huge, that's not a very large data set nor number of users. Look at these for starters: http://www.varlena.com/GeneralBits/Tidbits/perf.html http://www.varlena.com/GeneralBits/Tidbits/annotated_conf_e.html You might try setting the logging parameters to log queries longer than "x" (where x is in milliseconds - you will have to decide the appropriate value for "too long") and start looking into those first. Make sure that you are running "analyze" if it is not being run by autovacuum. Use "EXPLAIN " to see how the query is being planned - as a first-pass assume that on any reasonably sized table the words "sequential scan" means "fix this". Note that you may have to cast variables in a query to match the variable in an index in order for the planner to figure out that it can use the index. Read the guidelines then take an educated stab at some settings and see how they work - other than turning off fsync, there's not much in postgresql.conf that will put your data at risk. Cheers, Steve