pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Greg Stark <gsstark@mit.edu>
To: Marc G. Fournier <scrappy@postgresql.org>
Cc: Greg Stark <gsstark@mit.edu>
Cc: Dennis Bjorklund <db@zigo.dhs.org>
Cc: pgsql-performance@postgresql.org
Subject: Re: *very* slow query to summarize data for a month ...
Date: 11 Nov 2003 14:51:22 -0500
Message-ID: <873ccuk7k5.fsf@stark.dyndns.tv> (raw)
In-Reply-To: <20031111141328.X56037@ganymede.hub.org>
References: <Pine.LNX.4.44.0311110747090.26313-100000@zigo.dhs.org>
	<878ymmkdb9.fsf@stark.dyndns.tv>
	<20031111141328.X56037@ganymede.hub.org>

"Marc G. Fournier" <scrappy@postgresql.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




view thread (19+ messages)  latest in thread

Message-ID: <873ccuk7k5.fsf@stark.dyndns.tv>
Permalink:  ../873ccuk7k5.fsf@stark.dyndns.tv/
Also on:    postgresql.org/message-id/873ccuk7k5.fsf@stark.dyndns.tv

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: gsstark@mit.edu, scrappy@postgresql.org, db@zigo.dhs.org
  Subject: Re: *very* slow query to summarize data for a month ...
  In-Reply-To: <873ccuk7k5.fsf@stark.dyndns.tv>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox