Advertisement
Guest User

Untitled

a guest
Feb 19th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. -- Add an index onto our computed column
  2. CREATE NONCLUSTERED INDEX IX_CarModel ON dbo.Cars (CarModel)
  3.  
  4. -- Check the execution plans again
  5. SELECT DISTINCT * FROM dbo.Cars WHERE JSON_VALUE(CarDetails, '$.model') = 'Golf'
  6. SELECT DISTINCT * FROM dbo.Cars WHERE CarModel = 'Golf'
  7. -- We now get index seeks!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement