Re: Views. Who use them ?
Posted in 1998
Manel Falc' wrote: > > Do you use them ? when ? are really they useful ? > I'd like to open a debate ... > > Manel Falc' > SEMIC, S.A. > Lleida-Catalonia-Spain Yes, sometimes, yes. In version 4.0 they were useless because the optimizer tended to treat them like temporaray tables. Now in 7.10+ (and presumably earlier - not used) they are optimized with the "calling" SQL. If you do your correct 3rd-normal design you'll get a lot of tables that users will find hard to use, even developers may have difficulty. So, you create user schemas containing views which present easier "tables" to query. Also, if you want users to be able to have access to only some rows in a table, views are the only way to achieve it unless you like programming and maintenance. Basically you SELECT ... WHERE mytable.owner = USER. You can also create views with fancy calculations and aggregation. They can simplify your application code no end. Views are much more portable than SPL. Admittedly, they aren't pre-optimized but this should not be too much of a burden. -- Peter Lancashire Information Systems Specialist, Bayer plc Eastern Way, Bury St Edmunds, Suffolk, IP32 7AH, UK Tel: +44-1635-562258, Fax: +44-1635-562281 Mail: Peter.Lancashire.PL1@bayer.co.uk My Internet plumbing does not allow me to mail and post news together. Sorry. All opinions are my own and not those of Bayer plc.