Re: Can this query be optimized? - Mailing list pgsql-sql

From Tom Lane
Subject Re: Can this query be optimized?
Date
Msg-id 16760.1005229805@sss.pgh.pa.us
Whole thread Raw
In response to Can this query be optimized?  (Claus Heiko Niesen <cniesen@gmx.net>)
Responses Re: Can this query be optimized?
Re: Can this query be optimized?
List pgsql-sql
Claus Heiko Niesen <cniesen@gmx.net> writes:
> I'm stuck optimizing the following query:
> select distinct extract(year from date) as year, extract(month from date) 
> as month, date from week_pics order by date desc;

Perhaps it would work to forget the "distinct" and instead GROUP BY
date.
        regards, tom lane


pgsql-sql by date:

Previous
From: qradius@qnet.com.pe
Date:
Subject: help with function and quotes
Next
From: "Tille, Andreas"
Date:
Subject: Re: Design Tool for postgresql