I am troubleshooting this slow stored procedure and when checking the actual execution plan I noticed a warning of a possible missing index. Taking a closer look, it's against one of the views, not an actual table. How can that be possible?
Of course, the physical table is being used but the actual view it is not!
The view is something like this:
CREATE VIEW [ws].[MyVIEWTable]
WITH SCHEMABINDING
AS
SELECT col1, col2
FROM [dbo].[MyTable]
Why does the SQL Server engine use the view to retrieve data and not the actual physical table, which on this case would be dbo.MyTable
?
Aucun commentaire:
Enregistrer un commentaire