Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Indexing a View in Sql Server 2008 actually duplicate the original data?

If i create an Indexed View (in Sql Server 2008), does this mean i copy all required the data from the source tables into a separate new table? Or are only some tiny pointers/indexes saved, to represent this view?

like image 615
Pure.Krome Avatar asked Jan 21 '23 11:01

Pure.Krome


2 Answers

Yes, the data is copied and stored separately, so if you modify the underlying table, your indexed view will update automatically. This causes a lot of lock contention. Also the indexed view may grow larger than the underlying tables and become counterproductive.

like image 173
A-K Avatar answered May 03 '23 05:05

A-K


Yes, the data is copied. Other database platforms such as Oracle refer to this as a Materialized View because the data will materialize into a physical form.

like image 40
Joe Stefanelli Avatar answered May 03 '23 06:05

Joe Stefanelli