Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Add an index onto our computed column
- CREATE NONCLUSTERED INDEX IX_CarModel ON dbo.Cars (CarModel)
- -- Check the execution plans again
- SELECT DISTINCT * FROM dbo.Cars WHERE JSON_VALUE(CarDetails, '$.model') = 'Golf'
- SELECT DISTINCT * FROM dbo.Cars WHERE CarModel = 'Golf'
- -- We now get index seeks!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement