pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PFC <lists@boutiquenumerique.com>
To: Adrian Holovaty <postgresql@holovaty.com>
To: pgsql-performance@postgresql.org
Subject: Re: Index on a function and SELECT DISTINCT
Date: Mon, 17 Jan 2005 19:17:57 +0100
Message-ID: <opskref7qdth1vuj@musicbox> (raw)
In-Reply-To: <200501171159.24797.postgresql@holovaty.com>
References: <200501141232.13139.postgresql@holovaty.com>
	<20050117100942.692be97a.frank@wiles.org>
	<200501171159.24797.postgresql@holovaty.com>



	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
>





view thread (4+ messages)

Message-ID: <opskref7qdth1vuj@musicbox>
Permalink:  ../opskref7qdth1vuj@musicbox/
Also on:    postgresql.org/message-id/opskref7qdth1vuj@musicbox

 · 

reply

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: lists@boutiquenumerique.com, postgresql@holovaty.com
  Subject: Re: Index on a function and SELECT DISTINCT
  In-Reply-To: <opskref7qdth1vuj@musicbox>

* 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