Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 6020D64FE2D for ; Thu, 20 Nov 2008 05:12:41 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 75882-04 for ; Thu, 20 Nov 2008 05:12:38 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from smtp-out.neti.ee (smtp-out.neti.ee [194.126.126.44]) by mail.postgresql.org (Postfix) with ESMTP id 9B95C64FC5A for ; Thu, 20 Nov 2008 05:12:38 -0400 (AST) X-Virus-Scanned: Debian amavisd-new at estpak.ee Received: from Relayhost1.neti.ee (Relayhost1 [88.196.174.141]) by MXR-8.estpak.ee (Postfix) with ESMTP id 7BF7414FD77; Thu, 20 Nov 2008 11:12:33 +0200 (EET) X-SMTP-Auth-NETI-Businesmail: no Received: from andrusnotebook (unknown [195.50.198.194]) by Relayhost1.neti.ee (Postfix) with SMTP id 176522A58AC; Thu, 20 Nov 2008 11:12:33 +0200 (EET) Message-ID: From: "Andrus" To: , "PFC" References: In-Reply-To: Subject: Re: Hash join on int takes 8..114 seconds Date: Thu, 20 Nov 2008 11:12:17 +0200 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="utf-8"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Windows Mail 6.0.6001.18000 X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6001.18049 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200811/173 X-Sequence-Number: 31904 > Just a question, what are you doing with the 20.000 result rows ? Those rows represent monthly sales data of one item. They are used as following: 1. Detailed sales report for month. This report can browsed in screen for montly sales and ordering analysis. 2. Total reports. In those reports, sum( sales), sum(quantity) is used to get total sales in day, week, month, time for item and resulting rows are summed. Andrus.