Wednesday, November 25, 2009

AND & OR & NOT and its relation with SQL performance

* Using the AND operator typically results in a smaller result set, thus improving performance

* The NOT operator typically hurts performance because the query optimizer cannot use indexes for the where clause when a NOT operator is specified

* For Indexes to be utilized when an OR operator is specified, all columns referenced by the OR condition must be included in an index or none of the indexes are used

No comments:

Post a Comment