|
Posted by manstein on 10/02/72 11:36
page 488 - 489 The Guru's Guide to SQL Server Architecture and
Internals. Ken Henderson gives this code as an example of folding:
SELECT *
FROM Orders
WHERE ISNULL(Orderdate,getdate())>'2003-04-06 19:55:00.000'
Now, if you check the execution plan, you will see that there is an
index scan on the Orderdate column. Apparently Henderson considers
this an efficient use of an index; hence a good example of optimization
through folding. Similarly, my code also uses a index scan which is
far better than a table scan. Though you do make the distinction above
between index scan and index seek, based on the examination of the
execution plans, your suggestion that my code is in-efficient is
unwarrented. Thanks!
Navigation:
[Reply to this message]
|