Re: Index on a function and SELECT DISTINCT

From: PFC <lists(at)boutiquenumerique(dot)com>
To: "Adrian Holovaty" <postgresql(at)holovaty(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Index on a function and SELECT DISTINCT
Date: 2005-01-17 18:17:57
Message-ID: opskref7qdth1vuj@musicbox
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Try :

EXPLAIN SELECT get_year_trunc(pub_date) as foo FROM ... GROUP BY foo

Apart from that, you could use a materialized view...

>> > db=# EXPLAIN SELECT DISTINCT get_year_trunc(pub_date) FROM

> Ah, that makes sense. So is there a way to optimize SELECT DISTINCT
> queries
> that have no WHERE clause?
>
> Adrian
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faqs/FAQ.html
>

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Kaloyan Iliev Iliev 2005-01-17 18:57:10 Re: Performance problem from migrating between versions!
Previous Message Kaloyan Iliev Iliev 2005-01-17 18:15:31 Re: Performance problem from migrating between versions!