Tác giả minh họa theo kịch bản sau:
- Ban đầu câu truy vấn dùng Index Scan
 - Add thêm một Covering Non-clustered index để Query Optimizer dùng Index Scan trên Index này, ta thấy performance nhanh hơn 1 chút bằng cách so sánh thông số I/O (dùng Set Statistics On)
 - Tiếp tục sửa mệnh đề where không dùng function để Query Optimizer dùng Index Seek thay vì Index Scan cho Covering Non-clustered Index ở trên
 - Dùng Statistics IO để so sánh sự khác biệt về performance.
 
http://www.sqlskills.com/blogs/paul/adventures-in-query-tuning-non-seekable-where-clause-expressions/
0 comments:
Post a Comment