Re: Index on a function and SELECT DISTINCT - Mailing list pgsql-performance

From PFC
Subject Re: Index on a function and SELECT DISTINCT
Date
Msg-id opskref7qdth1vuj@musicbox
Whole thread Raw
In response to Re: Index on a function and SELECT DISTINCT  (Adrian Holovaty <postgresql@holovaty.com>)
List 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
>



pgsql-performance by date:

Previous
From: Tom Lane
Date:
Subject: Re: Performance problem from migrating between versions!
Next
From: Kaloyan Iliev Iliev
Date:
Subject: Re: Performance problem from migrating between versions!