Forum Discussion
SQL View performance
shortly, In this scenario, indexed views should improve query performance, but it still need to be tested at different data scales. In addition, base tables containing TEXT types can not be included in indexed view, see the https://learn.microsoft.com/en-us/sql/relational-databases/views/create-indexed-views?view=sql-server-ver16#deterministic-view-requirement. Change the column to NVARCHAR(MAX) if possible.
Index( IX_MyTable_Code ) in your base table MyTable will not be used in your final query. View vw_MyTable parses json fields from table column. Build indexes base on the fields extract from json string will great improve the performance of search specific fields.
You can also provide some sample data of column Row_Values for further analysis.
Hello.
Just a pointer: as far is performance is concerned compiled stored procedure are faster then views.
Hope this helps