January 2008
Intermediate to advanced
384 pages
8h 1m
English
The type of SELECT statement and its purpose can classify VIEWs. The strong advantage of a VIEW is that it will produce the correct results when it is invoked, based on the current data. Trying to do the same sort of things with temporary tables or computed columns within a table can be subject to errors and slower to read from disk.
In practice, many VIEWs are projections or restrictions on a single base table. This is a common method for security control by removing rows or columns that a particular group of users is not allowed to see. These VIEWs are usually implemented by in-line macro expansion, since the optimizer can easily fold their code into the final query plan.
Read now
Unlock full access