That'll teach me to post too early in the morning (I'm in Tokyo) and before coffee. :-)
Brett Wooldridge wrote:Ummm, last time I checked, 2 was greater than 1. :)
One could argue that in the first case (2>1), the optimizer is free to choose whatever index it wants because the query can provably return no rows. However, in the second case (1=1), were the DateTimestamp condition must be evaluated, it would appear that the optimizer indeed selected the wrong index.