SQL - View

> (Data|State) Management and Processing > (Data Type|Data Structure) > (Relation|Table) - Tabular data > Structured Query Language (SQL)

1 - About

A view is a view onto one or more tables with or without filters.

A view is stored as an algebraic closure so it can be optimized when used with queries.

Advertising

3 - View are slow

That is just not true. A view is nothing more than a stored query. If the stored query text is slow, sure the view (or query against the view) will be slow. A view cannot be any slower than the query itself. When you use the specific query as defined by the view in straight SQL, you'll see the same performance.

4 - Inconvenient / Advantage

4.1 - Inconvenient

4.1.1 - No referential integrity

If you get an employee table for instance in a view format, you cannot make a foreign key constraint because the view doesn't have any primary key.

4.1.2 - No grain management

You cannot enforce an unique key and then you can get duplicate problem. If not now, in the future.

4.2 - Advantage

Easy to implement

5 - Management

5.1 - List