Our sites are getting pounded pretty hard so we're taking a look into optimizing some of our existing queries.
While looking into this we ran across several queries whose execution plan was about 4-5 times faster when a simple reference of the clustered index is in the query... for example
If this was the old query:
SELECT ...
FROM myTable
WHERE categoryID = @category
the following query would be 4 times faster according to the execution plan in SSMS:
SELECT ...
FROM myTable
WHERE categoryID = @category
AND lotID = lotID
We can't seem to make sense of how this would make the query faster. The clustered index is on lotID but since its doing a comparison against itself how is this helping?