X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id DBFBDD1D696 for ; Tue, 13 Jan 2004 21:41:35 +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 50858-01 for ; Tue, 13 Jan 2004 17:41:06 -0400 (AST) Received: from chronozon.artofdns.com (CPE00e0293a847c-CM014400123697.cpe.net.cable.rogers.com [65.50.107.91]) by svr1.postgresql.org (Postfix) with ESMTP id 77CC0D1D556 for ; Tue, 13 Jan 2004 17:41:01 -0400 (AST) Received: by chronozon.artofdns.com (Postfix, from userid 501) id ACBD0DDD0; Tue, 13 Jan 2004 16:40:57 -0500 (EST) Date: Tue, 13 Jan 2004 16:40:57 -0500 From: Stef To: pgsql-sql@postgresql.org Subject: Historical logging of pg_stat_activity ? Message-ID: <20040113214057.GA24821@survivor.hades> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200401/120 X-Sequence-Number: 16513 hello everyone, Yes, yet agian i have a rather crazy idea, go with me on this and hopefully it will make a bit more sense than normal :) Currently, i have a rather extensive application that gets a lot of queries, i was wanting to track the general 'usage' pattern overtime, but of course, that would require a sort of 'historical view' of pg_stat_activity. If there was such a thing, then it would let me isolate hotspots or queries that were often used and allow me to focus on them first for speed benefits, as well as allowing me to produce some nifty histograms :) So, the long and short, is there a pg_stat table that contains the most 'used' queries and also (i know i am shooting for the moon here) execution time ? I know i -could- log_timestamp and log_statement and then parse out (using perl) the most called ones for each day and then sort them all and ... but thats a bit of a pain if there is already such a thing in existence. regards Stef