X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 9A0D0D1EF7A for ; Wed, 21 Jan 2004 01:45:32 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 98246-02 for ; Tue, 20 Jan 2004 21:45:04 -0400 (AST) Received: from houston.familyhealth.com.au (fhnet.arach.net.au [203.22.197.21]) by svr1.postgresql.org (Postfix) with ESMTP id BAA18D1EF8F for ; Tue, 20 Jan 2004 20:21:17 -0400 (AST) Received: from familyhealth.com.au (work-40.internal [192.168.0.40]) by houston.familyhealth.com.au (8.12.9p1/8.12.9) with ESMTP id i0L0LJOv082663; Wed, 21 Jan 2004 08:21:19 +0800 (WST) (envelope-from chriskl@familyhealth.com.au) Message-ID: <400DC6D7.1040705@familyhealth.com.au> Date: Wed, 21 Jan 2004 08:24:55 +0800 From: Christopher Kings-Lynne User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Orion Henry Cc: pgsql-performance@postgresql.org Subject: Re: database profiling References: <1074628029.1563.521.camel@orthanc> In-Reply-To: <1074628029.1563.521.camel@orthanc> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200401/203 X-Sequence-Number: 5377 > 1) Statistics kept on all the tables and indexes showing the number of > times and the number of milliseconds spent sequential scanning / index > scanning them. You could easily identify an index that's not being used > or a table that's being sequential scanned too often. Also supply a > database command to reset the statistic gather to zero. Enable the stats collector in your postgresql.conf, and then look at the pg_stat_* views. They are your friend. > 2) Statics that show count/total times to insert into/updating/deleting > from a table with time times spent in table and index separated so you > could see how much the indexes are effecting the write performance on > the table. Lots of that is in the pg_statio_* tables (if you have the collector running) > 3) The ability to view the current running time, plan and SQL text of > all currently running queries. That's in the pg_stat_activity table. There's also a new postgresql.conf setting in 7.4 that lets you log any query that runs more than a certain number of milliseconds - which is very useful for tracking down your slow queries. Chris