4 ms·
I got 4/5 (background: C++/C# programmer who sometimes works with SQL queries). The one I got wrong was the first one; I thought the query optimizer would be sm
by captaincrowbar 9y ago
I got 4/5 (background: C++/C# programmer who sometimes works with SQL queries). The one I got wrong was the first one; I thought the query optimizer would be smart enough to spot that the date function could be turned into a range query, but apparently not.
It's interesting to compare this with the 4th question, which more or less does exactly the same thing only with text instead of dates. They both have a WHERE clause that superficially tests the result of a function call but can be easily transformed into a simple range check on an indexed column. I don't know why the optimizer seems to be able to handle one case but not the other.