X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 467FB5281C for ; Mon, 30 May 2005 06:26:22 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 71095-03 for ; Mon, 30 May 2005 09:26:12 +0000 (GMT) Received: from exobox.exoweb.net (unknown [221.122.43.98]) by svr1.postgresql.org (Postfix) with SMTP id 855ED52819 for ; Mon, 30 May 2005 06:26:05 -0300 (ADT) Received: (qmail 7864 invoked from network); 30 May 2005 09:19:51 -0000 Received: from exo185.exoweb.net (HELO tobias.nordicbet.invalid) (192.168.0.185) by 0 with SMTP; 30 May 2005 09:19:51 -0000 Received: by tobias.nordicbet.invalid (Postfix, from userid 500) id 4C6756F76D; Mon, 30 May 2005 17:19:51 +0800 (CST) Date: Mon, 30 May 2005 17:19:51 +0800 From: Tobias Brox To: pgsql-performance@postgresql.org Subject: timestamp indexing Message-ID: <20050530091951.GO26100@tobias.exoweb.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Organization: Group Nordicbet User-Agent: Mutt/1.5.6i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200505/429 X-Sequence-Number: 12593 We have a production database with transaction-style data, in most of the tables we have a timestamp attribute "created" telling the creation time of the table row. Naturally, this attribute is always increasing. By now we are hitting the limit where the table data does not fit in caches anymore. We have a report section where there are constantly requests for things like "sum up all transactions for the last two weeks", and those requests seem to do a full table scan, even though only the last parts of the table is needed - so by now those reports have started to cause lots of iowait. Is there any way to avoid this, apart from adding memory linearly with database growth, make adjunct tables for historical rows, or build a separate data warehousing system? There must be some simpler solutions, right? -- Tobias Brox, Beijing