pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: JS Ubei <jsubei@yahoo.fr>
To: pgsql-performance@postgresql.org
Subject: optimize query with a maximum(date) extraction
Date: Wed, 5 Sep 2007 09:53:22 +0000 (GMT)
Message-ID: <302443.65402.qm@web26209.mail.ukl.yahoo.com> (raw)

Hi all,

I need to improve a query like :

SELECT id, min(the_date), max(the_date) FROM my_table GROUP BY id;

Stupidly, I create a B-tree index on my_table(the_date), witch is logically not used in my query, because it's not with a constant ? isn't it ?

I know that I can't create a function index with an aggregative function.

How I can do ?

thanks,

jsubei




      _____________________________________________________________________________ 
Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail 



view thread (12+ messages)  latest in thread

Message-ID: <302443.65402.qm@web26209.mail.ukl.yahoo.com>
Permalink:  ../302443.65402.qm@web26209.mail.ukl.yahoo.com/
Also on:    postgresql.org/message-id/302443.65402.qm@web26209.mail.ukl.yahoo.com

 · 

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: jsubei@yahoo.fr
  Subject: Re: optimize query with a maximum(date) extraction
  In-Reply-To: <302443.65402.qm@web26209.mail.ukl.yahoo.com>

* 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