X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (mx2.hub.org [200.46.204.254]) by postgresql.org (Postfix) with ESMTP id A953511F6C80 for ; Thu, 20 Apr 2006 07:48:58 -0300 (ADT) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Score: -2.464 X-Spam-Level: X-Spam-Status: No, score=-2.464 required=5 tests=[BAYES_00=-2.599, FORGED_RCVD_HELO=0.135] Received: from postgresql.org ([200.46.204.71]) by localhost (mx2.hub.org [200.46.204.254]) (amavisd-new, port 10024) with ESMTP id 6Kr1v53KhfBr for ; Thu, 20 Apr 2006 07:48:50 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail.rentalia.net (mail.rentalia.com [213.192.209.8]) by postgresql.org (Postfix) with ESMTP id F111111F66C1 for ; Thu, 20 Apr 2006 07:48:47 -0300 (ADT) Received: (qmail 13942 invoked by uid 514); 20 Apr 2006 13:49:58 +0200 Received: from 62.37.217.76 by rigodon (envelope-from , uid 512) with qmail-scanner-1.25-st-qms (clamdscan: 0.88/1284. spamassassin: 3.0.2. perlscan: 1.25-st-qms. Clear:RC:0(62.37.217.76):SA:0(-2.1/5.0):. Processed in 1.660478 secs); 20 Apr 2006 11:49:58 -0000 X-Antivirus-MYDOMAIN-Mail-From: ruben@rentalia.com via rigodon X-Antivirus-MYDOMAIN: 1.25-st-qms (Clear:RC:0(62.37.217.76):SA:0(-2.1/5.0):. Processed in 1.660478 secs Process 13929) Received: from 62-37-217-76.mad1.adsl.uni2.es (HELO ?192.168.2.28?) (ruben@rentalia.com@62.37.217.76) by mail.rentalia.net with SMTP; 20 Apr 2006 13:49:56 +0200 Message-ID: <44476706.90303@rentalia.com> Date: Thu, 20 Apr 2006 12:48:38 +0200 From: Ruben Rubio Rey User-Agent: Mozilla Thunderbird 1.0.7 (X11/20051011) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Doron Baranes , pgsql-performance@postgresql.org Subject: Re: Perfrmance Problems (7.4.6) References: <0BA77301DFF4B24C9C5DAA74138BF95001E231@exchange-1.dbnet.co.il> In-Reply-To: <0BA77301DFF4B24C9C5DAA74138BF95001E231@exchange-1.dbnet.co.il> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Archive-Number: 200604/439 X-Sequence-Number: 18523 I think that the problem is the GROUP BY (datetime) that is date_trunc('hour'::text, i.entry_time) You should create an indexe with this expression (if its possible). http://www.postgresql.org/docs/7.4/interactive/indexes-expressional.html If is not possible, I would create a column with value date_trunc('hour'::text, i.entry_time) of each row and then index it. Hope this helps :) Doron Baranes wrote: >Hi, > >I am running on postgres 7.4.6. >I did a vacuum analyze on the database but there was no change. >I Attached here a file with details about the tables, the queries and >the Explain analyze plans. >Hope this can be helpful to analyze my problem > >10x >Doron > > >------------------------------------------------------------------------ > > >---------------------------(end of broadcast)--------------------------- >TIP 9: In versions below 8.0, the planner will ignore your desire to > choose an index scan if your joining column's datatypes do not > match > >