Details
-
Task
-
Status: Open (View Workflow)
-
Minor
-
Resolution: Unresolved
-
None
-
None
-
None
Description
When I was a young and foolish developer, I used to write queries containing things like this :
SELECT * FROM table WHERE `mydate` LIKE '2013-02-%'
which is of course WAAAAAAY slower than
SELECT * FROM table WHERE `mydate` BETWEEN '2013-02-01' AND '2013-03-01'
I'm probably not the only one who ever used a LIKE on a date field for querying subsets based on years, months, days, hours...
It might be interesting to optimize these queries as it should be pretty simple and lead to big performance gains for those who don't really understand what's happening under the hood when the queries they write are executed.