X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id F29DDD89FA for ; Thu, 1 Sep 2005 10:23:12 -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 10334-01 for ; Thu, 1 Sep 2005 13:23:11 +0000 (GMT) Received: from thor.netera.se (thor.netera.se [85.112.172.11]) by svr1.postgresql.org (Postfix) with ESMTP id BA974D8959 for ; Thu, 1 Sep 2005 10:23:09 -0300 (ADT) Received: from [192.168.2.240] (1-1-1-41a.o.sth.bostream.se [81.26.246.14]) by thor.netera.se (Postfix) with ESMTP id 27E9A13AC01C for ; Thu, 1 Sep 2005 15:23:13 +0200 (CEST) Message-ID: <43170151.90408@relevanttraffic.se> Date: Thu, 01 Sep 2005 15:25:37 +0200 From: Ulrich Wisser Organization: Relevant Traffic AB User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716) X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Need for speed 3 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.001 required=5 tests=[AWL=0.001] X-Spam-Level: X-Archive-Number: 200509/3 X-Sequence-Number: 14311 Hi again, first I want to say ***THANK YOU*** for everyone who kindly shared their thoughts on my hardware problems. I really appreciate it. I started to look for a new server and I am quite sure we'll get a serious hardware "update". As suggested by some people I would like now to look closer at possible algorithmic improvements. My application basically imports Apache log files into a Postgres database. Every row in the log file gets imported in one of three (raw data) tables. My columns are exactly as in the log file. The import is run approx. every five minutes. We import about two million rows a month. Between 30 and 50 users are using the reporting at the same time. Because reporting became so slow, I did create a reporting table. In that table data is aggregated by dropping time (date is preserved), ip, referer, user-agent. And although it breaks normalization some data from a master table is copied, so no joins are needed anymore. After every import the data from the current day is deleted from the reporting table and recalculated from the raw data table. Is this description understandable? If so What do you think of this approach? Are there better ways to do it? Is there some literature you recommend reading? TIA Ulrich