some databases will do a full scan if the where condition looks too complicated (for the db engine.) wherever possible make sure that values in tested column(s) don't need casting for comparison, and simplify the condition as much as possible. In this particular case, instead of >=20071204 can be written as >20071203.