What are indexed views, and does Oracle support them?
As you may already know, a view is a "virtual table". I like to think of a view as a stored SQL statement. A view does not actually contain data, but just a SQL statement to get data from one or more tables.
The performance of a view is tied directly to the performance of the view's underlying SQL statement. Some systems will let you create an index on the view so that selecting data from the view will be faster. Oracle databases do not support indexing views.
But Oracle does support a Materialized View (MV). A MV is like a view, but it does contain data. MV's are primarly used for preaggregating results to speed up performance. And you can place an index here.
For More Information
- Dozens more answers to tough Oracle questions from Brian Peasland are available.
- The Best Oracle Web Links: tips, tutorials, scripts, and more.
- Have an Oracle or SQL tip to offer your fellow DBAs and developers? The best tips submitted will receive a cool prize. Submit your tip today!
- Ask your technical Oracle and SQL questions -- or help out your peers by answering them -- in our live discussion forums.
- Ask the Experts yourself: Our SQL, database design, Oracle, SQL Server, DB2, metadata, object-oriented and data warehousing gurus are waiting to answer your toughest questions.