Re: *very* slow query to summarize data for a month ...

From: Greg Stark <gsstark(at)mit(dot)edu>
To: "Marc G(dot) Fournier" <scrappy(at)postgresql(dot)org>
Cc: Greg Stark <gsstark(at)mit(dot)edu>, Dennis Bjorklund <db(at)zigo(dot)dhs(dot)org>, pgsql-performance(at)postgresql(dot)org
Subject: Re: *very* slow query to summarize data for a month ...
Date: 2003-11-11 19:51:22
Message-ID: 873ccuk7k5.fsf@stark.dyndns.tv
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

"Marc G. Fournier" <scrappy(at)postgresql(dot)org> writes:

> On Tue, 11 Nov 2003, Greg Stark wrote:
>
> > Actually you might be able to get the same effect using function indexes
> > like:
> >
> > create index i on traffic_log (month_trunc(runtime), company_id)
>
> had actually thought of that one ... is it something that is only
> available in v7.4?

Hum, I thought you could do simple functional indexes like that in 7.3, but
perhaps only single-column indexes.

In any case, given your situation I would seriously consider putting a
"month" integer column on your table anyways. Then your index would be a
simple (month, company_id) index.

--
greg

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message scott.marlowe 2003-11-11 21:25:06 Re: *very* slow query to summarize data for a month ...
Previous Message Marc G. Fournier 2003-11-11 18:38:04 Re: *very* slow query to summarize data for a month ...