Given a time (eg. currently 4:24pm on Tuesday), I'd like to be able to select all businesses that are currently open out of a set of businesses.
- I have the open and close times for every business for every day of the week
- Let's assume a business can open/close only on 00, 15, 30, 45 minute marks of each hour
- I'm assuming the same schedule each week.
- I am most interested in being able to quickly look up a set of businesses that is open at a certain time, not the space requirements of the data.
- Mind you, some my open at 11pm one day and close 1am the next day.
- Holidays don't matter - I will handle these separately
What's the most efficient way to store these open/close times such that with a single time/day-of-week tuple I can speedily figure out which businesses are open?
I am using Python, SOLR and mysql. I'd like to be able to do the querying in SOLR. But frankly, I'm open to any suggestions and alternatives.