Re: [HACKERS] Idea: GSoC - Query Rewrite with Materialized Views

2015-03-03 Thread Jim Nasby
On 3/3/15 3:34 PM, David Fetter wrote: On Tue, Mar 03, 2015 at 05:49:06PM -0300, Alvaro Herrera wrote: Jim Nasby wrote: FWIW, what I would find most useful at this point is a way to get the equivalent of an AFTER STATEMENT trigger that provided all changed rows in a MV as the result of a state

Re: [HACKERS] Idea: GSoC - Query Rewrite with Materialized Views

2015-03-03 Thread David Fetter
On Tue, Mar 03, 2015 at 05:49:06PM -0300, Alvaro Herrera wrote: > Jim Nasby wrote: > > > FWIW, what I would find most useful at this point is a way to get > > the equivalent of an AFTER STATEMENT trigger that provided all > > changed rows in a MV as the result of a statement. > > Ah, like > https

Re: [HACKERS] Idea: GSoC - Query Rewrite with Materialized Views

2015-03-03 Thread Alvaro Herrera
Jim Nasby wrote: > FWIW, what I would find most useful at this point is a way to get the > equivalent of an AFTER STATEMENT trigger that provided all changed rows in a > MV as the result of a statement. Ah, like https://www.postgresql.org/message-id/1402790204.65037.YahooMailNeo%40web122301.mail.

Re: [HACKERS] Idea: GSoC - Query Rewrite with Materialized Views

2015-03-03 Thread Eric Grinstein
> > I think even something that just does that in pure SQL/plpgsql would be a > big step forward, even if we wouldn't want it directly in the codebase. Something like creating a trigger under the hood each time a MV is created, that checks the changed rows on every statement against the query th

Re: [HACKERS] Idea: GSoC - Query Rewrite with Materialized Views

2015-03-02 Thread Jim Nasby
On 3/2/15 9:03 AM, Kevin Grittner wrote: The query rewrite feature would be extremely desirable for us. >Do you think that implementing the staleness check as suggested >by Thomas could get us started in the query rewrite business? There are many aspects related to the definition, maintenance, a

Re: [HACKERS] Idea: GSoC - Query Rewrite with Materialized Views

2015-03-02 Thread Kevin Grittner
Eric Grinstein wrote: > I would be very interested in tracking the staleness of the MV. > You see, I work in a research group in database tuning, and we > have implemented some solutions to take advantage of MV's and > speed up queries. Please be sure, right up front, that there are no intellect

Re: [HACKERS] Idea: GSoC - Query Rewrite with Materialized Views

2015-02-26 Thread Eric Grinstein
Thank you for your answers. I would be very interested in tracking the staleness of the MV. You see, I work in a research group in database tuning, and we have implemented some solutions to take advantage of MV's and speed up queries. The query rewrite feature would be extremely desirable for us. D

Re: [HACKERS] Idea: GSoC - Query Rewrite with Materialized Views

2015-02-20 Thread Tomas Vondra
On 21.2.2015 00:20, Kevin Grittner wrote: > Tomas Vondra wrote: > >> I share the view that this would be very valuable, but the scope >> far exceeds what can be done within a single GSoC project. But >> maybe we could split that into multiple pieces, and Eric would >> implement only the first pie

Re: [HACKERS] Idea: GSoC - Query Rewrite with Materialized Views

2015-02-20 Thread Kevin Grittner
Tomas Vondra wrote: > I share the view that this would be very valuable, but the scope > far exceeds what can be done within a single GSoC project. But > maybe we could split that into multiple pieces, and Eric would > implement only the first piece? > > For example the 'is_stale' flag for a MV w

Re: [HACKERS] Idea: GSoC - Query Rewrite with Materialized Views

2015-02-20 Thread Tomas Vondra
On 20.2.2015 22:45, Kevin Grittner wrote: > > Oracle, MS SQL Server, Sybase ASE, and IBM DB2 all have this. (There > may be others.) In essence they treat an MV a bit like an index, as > something you can create to speed up an existing query without > rewriting it. It would certainly be nice to

Re: [HACKERS] Idea: GSoC - Query Rewrite with Materialized Views

2015-02-20 Thread Kevin Grittner
Eric Grinstein wrote: > I'm very excited about contributing to Postgres, and thought GSoC > would be a very good program to get me started. Great! > Some commercial RDBMS such as oracle implement a feature called > 'Query Rewrite' using materialized views. When a query is being > processed, the

[HACKERS] Idea: GSoC - Query Rewrite with Materialized Views

2015-02-20 Thread Eric Grinstein
Hello Everyone, I'm Eric Grinstein, an Comp. Engineering undergrad at PUC-Rio, Brazil. I'm very excited about contributing to Postgres, and thought GSoC would be a very good program to get me started. Some commercial RDBMS such as oracle implement a feature called 'Query Rewrite' using materializ