Re: [ADMIN] Using Views as Tables - Mailing list pgsql-admin

From David L
Subject Re: [ADMIN] Using Views as Tables
Date
Msg-id CANcS_tfyZui9t7vgx_F4FKgdxQJeLTXZ4y_T7t3pywfup1FjjQ@mail.gmail.com
Whole thread Raw
In response to [ADMIN] Using Views as Tables  (David L <segedunum@actuaria.co.uk>)
Responses Re: [ADMIN] Using Views as Tables  (Simon Riggs <simon@2ndquadrant.com>)
List pgsql-admin
Yes I know. That's the point.

On 9 Jan 2017 1:46 a.m., "Scott Marlowe" <scott.marlowe@gmail.com> wrote:
On Sun, Jan 8, 2017 at 11:35 AM, David L <segedunum@actuaria.co.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.

pgsql-admin by date:

Previous
From: David L
Date:
Subject: Re: [ADMIN] Using Views as Tables
Next
From: Simon Riggs
Date:
Subject: Re: [ADMIN] Using Views as Tables