-
Which of the following WHERE clauses is faster?
1. WHERE col * 3 < 9
2. WHERE col < 9 / 3
-
- 2
- dependent on operating system
- 1
- same speed
- None of these
Correct Option: A
For the first variation, MySQL would retrieve the value of ‘col’ for each row, multiply by three, and then compare the result to nine. In this case, no index can be used and hence it is slower.