Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: views: good, bad, mixed?
Answers embedded
Hth,
Sybrand Bakker, Oracle DBA
"justanotherposter" <ltohill_at_twcny.rr.com> wrote in message
news:901t48$l8$1_at_nnrp1.deja.com...
> I'm looking for opinions regarding the use of database views.
>
> What are the advantages of views?
Simplyfing selects, creating 'subsets' of data. Ie in my case I have a table from which I always have to select the records with status 'white'. You would better hide 'where status=1 /* the code for white */ ' in a view.
>
> What are disadvantages?
They are compiled. Also you can't use * as the * is resolved at compile
time. If you change your underlying table, you will be forced to recreate
the view.
Also the optimizer usually considers them as an independent unit, so it
doesn't 'merge' the view with the rest of your statement.
>
> Would you recommend that developers use views for all database
> retrievals?
That would be an extreemly bad move!
> Why or why not?
See above.
>
> What about views that use views?
>
Bad idea. The chance the optimizer will choose inefficient access paths will
increase using views on views.
> WHere/when do you use a view?
>
> How does a goal of DBMS portability affect your opinion, especially
> with respect to using views in
> development?
>
>
> TIA
>
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Received on Wed Nov 29 2000 - 00:49:07 CST