Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

As my subject suggests, I would like to know does creating views cause an overhead to DB in terms of space, storage, performance?

share|improve this question

1 Answer 1

up vote 7 down vote accepted

Refer the the Concepts Guide - Overview of Views for this sort of question:

Overview of Views

A view is a logical representation of one or more tables. In essence, a view is a stored query.
[...]

Characteristics of Views

Unlike a table, a view is not allocated storage space, nor does a view contain data. Rather, a view is defined by a query that extracts or derives data from the base tables referenced by the view. Because a view is based on other objects, it requires no storage other than storage for the query that defines the view in the data dictionary.

Whether creating a view can have an impact on performance or not isn't answerable. If you don't use it, it won't impact anything. If you use it and it happens that the query the view "represents" has poor performance characteristics, then it will have essentially the same bad impact as running the underlying query directly.

Now materialized views are a completely different concept, and do actually contain data. They can also impact the performance of SQL statements that don't explicitly mention them via query rewriting - but again, what sort of impact that would have isn't answerable without specific details.

(Materialized views are more frequently (but not exclusively) used in data warehousing-type scenarios, whereas plain views are simply all over the place.)

share|improve this answer
    
Thanks @Mat! You enlightened me on this Subject! –  hiFI Jan 3 at 13:04

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.