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 [EMAIL PROTECTED] 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/


---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Reply via email to