optimize query with a maximum(date) extraction - Mailing list pgsql-performance

From JS Ubei
Subject optimize query with a maximum(date) extraction
Date
Msg-id 302443.65402.qm@web26209.mail.ukl.yahoo.com
Whole thread Raw
Responses Re: optimize query with a maximum(date) extraction
Re: optimize query with a maximum(date) extraction
List pgsql-performance
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
aconstant ? 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

pgsql-performance by date:

Previous
From: Hannes Dorbath
Date:
Subject: Re: Performance on 8CPU's and 32GB of RAM
Next
From: "Gregory Williamson"
Date:
Subject: FW: optimize query with a maximum(date) extraction