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 6B1D511F65A5 for ; Thu, 20 Apr 2006 11:54:36 -0300 (ADT) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Score: -2.414 X-Spam-Level: X-Spam-Status: No, score=-2.414 required=5 tests=[AWL=0.050, 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 44bPR0Vng3gP for ; Thu, 20 Apr 2006 11:54:31 -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 BE3F811F6551 for ; Thu, 20 Apr 2006 11:54:28 -0300 (ADT) Received: (qmail 2423 invoked by uid 514); 20 Apr 2006 17:55:41 +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.2/5.0):. Processed in 1.851807 secs); 20 Apr 2006 15:55:41 -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.2/5.0):. Processed in 1.851807 secs Process 2406) 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 17:55:39 +0200 Message-ID: <4447A09D.9070600@rentalia.com> Date: Thu, 20 Apr 2006 16:54:21 +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: <0BA77301DFF4B24C9C5DAA74138BF95001E23C@exchange-1.dbnet.co.il> In-Reply-To: <0BA77301DFF4B24C9C5DAA74138BF95001E23C@exchange-1.dbnet.co.il> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Archive-Number: 200604/450 X-Sequence-Number: 18534 Did you tried to index the expression? Did it work? Doron Baranes wrote: >Ok. But that means I need a trigger on the original column to update the >new column on each insert/update and that overhead. > >-----Original Message----- >From: Ruben Rubio Rey [mailto:ruben@rentalia.com] >Sent: Thursday, April 20, 2006 12:49 PM >To: Doron Baranes; pgsql-performance@postgresql.org >Subject: Re: [PERFORM] Perfrmance Problems (7.4.6) > >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 >> >> >> >> > > >---------------------------(end of broadcast)--------------------------- >TIP 2: Don't 'kill -9' the postmaster > > > >