Re: Materialized view vs. view

From: Nicolas Paris <niparisco(at)gmail(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: Melvin Davidson <melvin6925(at)gmail(dot)com>, Kevin Grittner <kgrittn(at)gmail(dot)com>, Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, Job <Job(at)colliniconsulting(dot)it>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Materialized view vs. view
Date: 2017-01-10 21:30:08
Message-ID: 20170110213008.GC5870@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Le 10/33/2017 à 21:33, David G. Johnston écrivait :
> On Tue, Jan 10, 2017 at 1:01 PM, Melvin Davidson
> <[1]melvin6925(at)gmail(dot)com> wrote:
>
> Can we all agree that the "Materialized View" should be faster
> ​
>
Yes.
The OP told about a 500K rows view. Every select queries on that view will
have to fetch those 500K rows before - in any case this is quite slow.
However, 500K rows do not represent a huge physical space to
materialize. But do not forget to index/refresh the materialized views,
depending on the select set of queries to run.

Answer would have been different with 50K rows I guess.

>
> If you add in the condition that the same answer has to be returned
> whether you query the view or the mat-view then no, I wouldn't agree;
> and the original question is, IMO, unanswerable (or at least, if
> answered, requires making assumptions that tend to go unstated).
>
> is just an opinion and too late to change at this point?
>
> Your opinion, or the name? :)
> ​David J.​
>
> References
>
> 1. mailto:melvin6925(at)gmail(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Craig Boucher 2017-01-10 21:33:11 Table Design for Many Updates
Previous Message Kevin Grittner 2017-01-10 20:34:44 Re: Materialized view vs. view