Re: Can I use PostgreSQL to develop a self-organizing

From: Greg Stark <gsstark(at)mit(dot)edu>
To: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
Cc: Greg Stark <gsstark(at)mit(dot)edu>, pgsql-general(at)postgresql(dot)org
Subject: Re: Can I use PostgreSQL to develop a self-organizing
Date: 2003-09-08 22:29:42
Message-ID: 87r82q52y1.fsf@stark.dyndns.tv
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl> writes:

> On Mon, Sep 08, 2003 at 05:55:43PM -0400, Greg Stark wrote:
>
> > Materialized views are a godsend for DSS systems, and self-organized
> > materialized views sound too good to be true. Is this really feasible?
> > It sounds awfully ambitious considering postgres doesn't even have
> > materialized views yet.
>
> There is also the question of how would one actually use self-organizing
> views... what would be the syntax for them? Should the parser recognize
> that some join you are giving to it is a previously self-organized view
> and contract the sentence?

In an ideal world the database would just magically notice that I do a lot of
queries like: "SELECT count(*) FROM foo WHERE bar = ?"
and decide to materialize: "SELECT count(*),bar FROM foo GROUP BY bar"
(and figure out where to put the index.)

Then it would optimize all my queries to be a simple indexed lookup.

Of course it would also have to add rewrite rules or triggers to update the
materialized view on every update/insert/delete. So the code to decide when to
create the materialized view would have to keep statistics on these queries as
well to decide when it's worthwhile to create the materialized view... Nobody
said it was easy :)

--
greg

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Karsten Hilbert 2003-09-08 22:37:44 Re: Can I use PostgreSQL to develop a self-organizing
Previous Message Dennis Gearon 2003-09-08 22:24:40 Re: decrypted pwd