From: Dimitri <dimitrik.fr@gmail.com>
To: JS Ubei <jsubei@yahoo.fr>
Cc: pgsql-performance@postgresql.org
Subject: Re: optimize query with a maximum(date) extraction
Date: Sat, 8 Sep 2007 10:00:22 +0200
Message-ID: <5482c80a0709080100i266bc41ajae0b34825cc9af5e@mail.gmail.com> (raw)
In-Reply-To: <302443.65402.qm@web26209.mail.ukl.yahoo.com>
References: <302443.65402.qm@web26209.mail.ukl.yahoo.com>
BTW, will it improve something if you change your index to "my_table(
id, the_date )"?
Rgds,
-Dimitri
On 9/5/07, JS Ubei <jsubei@yahoo.fr> wrote:
> 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
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings
>
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: dimitrik.fr@gmail.com, jsubei@yahoo.fr
Subject: Re: optimize query with a maximum(date) extraction
In-Reply-To: <5482c80a0709080100i266bc41ajae0b34825cc9af5e@mail.gmail.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