Assuming that I have a database table with 10000 data and each record is registered with dates between 2013 and 2014.
A query like this:
SELECT CAMPO_DATA FROM TABELA WHERE CAMPO_DATA BETWEEN '2013-01-01' AND '2014-12-31'
will be faster than:
SELECT CAMPO_DATA FROM TABELA WHERE CAMPO_DATA BETWEEN '2000-01-01' AND '2100-12-31'
?
If I use the second form this can greatly affect the speed of the query if the table has many items?
I'm in doubt as to whether sql first sees the range of dates that the table has or whether it traverses according to the limits I've set.