Re: Views- Advantages and Disadvantages

From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: Dann Corbit <DCorbit(at)connx(dot)com>
Cc: Michael Glaesemann <grzm(at)seespotcode(dot)net>, Ashish Karalkar <ashish(dot)karalkar(at)info-spectrum(dot)com>, Andrej Ricnik-Bay <andrej(dot)groups(at)gmail(dot)com>, Ron Johnson <ron(dot)l(dot)johnson(at)cox(dot)net>, pgsql-general(at)postgresql(dot)org
Subject: Re: Views- Advantages and Disadvantages
Date: 2007-05-09 20:26:07
Message-ID: 46422E5F.5030904@commandprompt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


>>> Views can hide important information from the optimizer (especially
>>> index information).
>> Really? AIUI, views-at least in PostgreSQL-are implemented using
>> PostgreSQL's rule system: the entire query is rewritten to include
>> the view query, and the optimizer sees the rewritten query. What the
>> optimizer sees is the same as if the view were inlined in the
>> original query.
>
> That is a significant achievement, since many database systems do not
> have that ability.

Another advantage of views is the ability to give zero rights to access
the objects the view is on, but allow the user to execute the view
itself. This allows limiting the view to not only a specific where
clause but also specific columns the user will be able to view.

Joshua D. Drake

>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly
>

--

=== The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
Providing the most comprehensive PostgreSQL solutions since 1997
http://www.commandprompt.com/

Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate
PostgreSQL Replication: http://www.commandprompt.com/products/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Brad Nicholson 2007-05-09 20:27:29 Re: Dangers of fsync = off
Previous Message Joshua D. Drake 2007-05-09 20:24:56 Re: Views- Advantages and Disadvantages