Re: Can this query be optimized?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Claus Heiko Niesen <cniesen(at)gmx(dot)net>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Can this query be optimized?
Date: 2001-11-08 14:30:05
Message-ID: 16760.1005229805@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Claus Heiko Niesen <cniesen(at)gmx(dot)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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tille, Andreas 2001-11-08 14:45:22 Re: Design Tool for postgresql
Previous Message Denis Bucher 2001-11-08 11:06:14 Solution found ! Re: Need help with embedded CASEs