Ev.
Ev.

Reputation: 7589

What happens when a View is modified in SQL Server

So I have a large view in my production database that joins together data from a few tables. This is a legacy thing that I have no control over - it's just how it is.

I want to add a new clause to it (WHERE xx is not null), but am worried that there'll be a performance problem when I release it.

Basically, I don't know much about views. Will SQL Server have to rebuild the view? Rebuild indexes? do any large amount of processing?

Or are views interpreted on the fly?

Any point in the right direction would be appreciated!

Upvotes: 0

Views: 84

Answers (1)

Rab
Rab

Reputation: 35572

Views are only Stored queries, it does not cause to change in the physical data storage OR mechanism, etc.

  • Server have to rebuild the view?
  • Rebuild indexes?
  • Do large amount of processing?

None of the above happens, when view is changed

Edit

by Ben Thul

...assuming that the view is not an indexed view. To check, look in sys.indexes where [object_id] = object_id('your view'). If nothing comes back, the view has no indexes.

Mean to say... that index view will have affect on above pointes

Upvotes: 4

Related Questions