5

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

1 Answer 1

11

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.)

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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