Hacker News new | past | comments | ask | show | jobs | submit login

> ...`WHERE year(date)=2021` without actually running that function on every date, but rather automatically optimize it to an index lookup of `WHERE date between '2021-01-01' and '2021-12-31'`

Sure this would be handy. Are there engines that implement such optimization?

I can also see how the 'dated' WHERE clause could be used directly in SQLite to leverage the index. Of course, using year() is more expressive. It may also make sense in such a case to simply add a year column and have it indexed.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: