Re: Using Views as Tables

From: David L <segedunum(at)actuaria(dot)co(dot)uk>
To: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: Using Views as Tables
Date: 2017-01-09 08:22:42
Message-ID: CANcS_tfyZui9t7vgx_F4FKgdxQJeLTXZ4y_T7t3pywfup1FjjQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Yes I know. That's the point.

On 9 Jan 2017 1:46 a.m., "Scott Marlowe" <scott(dot)marlowe(at)gmail(dot)com> wrote:

> On Sun, Jan 8, 2017 at 11:35 AM, David L <segedunum(at)actuaria(dot)co(dot)uk> wrote:
> > I agree that in theory this shouldn't happen as the query planner should
> be
> > intelligent enough to take the base query out of the equation all
> together,
> > but this happens on a server where there should be a plentiful supply of
> > memory (32GB) and little enough activity that table data should remain
> > cached.
>
> I'm not sure you understand the underlying method for views in postgresql.
>
> Select * from view;
>
> is literally changed into
>
> select * from (yourviewdef here).
>
> I.e. the query planner does NOTHING different for a select from a view
> than if you just run the query that makes the up the view by hand.
>

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Simon Riggs 2017-01-09 08:28:58 Re: Using Views as Tables
Previous Message David L 2017-01-08 18:35:12 Re: Using Views as Tables