Re: count(*) performance improvement ideas - Mailing list pgsql-hackers

From Mark Mielke
Subject Re: count(*) performance improvement ideas
Date
Msg-id 47D81F53.1000001@mark.mielke.cc
Whole thread Raw
In response to Re: count(*) performance improvement ideas  (Gregory Stark <stark@enterprisedb.com>)
List pgsql-hackers
Gregory Stark wrote:
> In an ideal world I would love to be able to do something like:
>
> CREATE MATERIALIZED VIEW foo AS (select count(*) from bar) WITH INCREMENTAL UPDATES;
>
> and have that automatically create both a heap to store the count and another
> to store the incremental changes. To do this would require some magic to know
> what "incremental changes" means for each aggregate where it's meaningful
> though.
>
> Then it would require some magic in the optimizer to recognize when piece of
> the query can be satisfied by a materialized view.
>   

Hehe... +5 if you think it can be done in the next 12 - 24 months. :-)

Cheers,
mark

-- 
Mark Mielke <mark@mielke.cc>



pgsql-hackers by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: Re: TODO-list on wiki (was: TODO update about SQLSTATE to PGconn)
Next
From: Greg Smith
Date:
Subject: Re: [pgsql-www] Move the developers wiki?