On Fri, 14 Jan 2005 12:32:12 -0600
Adrian Holovaty [EMAIL PROTECTED] wrote:
If I have this table, function and index in Postgres 7.3.6 ...
CREATE TABLE news_stories (
id serial primary key NOT NULL,
pub_date timestamp with time zone NOT NULL,
...
)
CREATE OR REPLACE
Frank Wiles wrote:
Adrian Holovaty [EMAIL PROTECTED] wrote:
If I have this table, function and index in Postgres 7.3.6 ...
CREATE TABLE news_stories (
id serial primary key NOT NULL,
pub_date timestamp with time zone NOT NULL,
...
)
CREATE OR REPLACE FUNCTION
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
If I have this table, function and index in Postgres 7.3.6 ...
CREATE TABLE news_stories (
id serial primary key NOT NULL,
pub_date timestamp with time zone NOT NULL,
...
)
CREATE OR REPLACE FUNCTION get_year_trunc(timestamp with time zone) returns
timestamp with time zone AS