SQL views. do i need to use it to increase performance?
i mostly need to know - views a开发者_运维问答nd their purpose ? - do they increase performance of an application ? - in what kind of cicumstance will I need to use views?
As this is homework you should probably be doing research.
A quick Google yields plenty of links, one of which is http://www.techotopia.com/index.php/An_Introduction_to_MySQL_Views.
MySQL views are essentially a way to package up SELECT statements into re-usable virtual tables whereby the data can be retrieved simply by referencing the view, rather than having to repeat the associated SELECT statement.
The official site documentation is quite informative and readable too.
See: the MySQL FAQ page on Views and the Using Views documentation.
Views provide an abstraction layer over your tables.
They can be used to prevent access to certain sensitive columns (such as salary).
They are often used to encapsulate logic for reporting.
in what kind of cicumstance will I need to use views?
If you're repeatedly using the same SELECT
statement that uses lots of JOIN
s and/or function calls, a view makes it simpler to use.
精彩评论