Representing a schedule in a database
Posted
by David Pfeffer
on Stack Overflow
See other posts from Stack Overflow
or by David Pfeffer
Published on 2010-06-13T14:11:00Z
Indexed on
2010/06/13
14:12 UTC
Read the original article
Hit count: 341
I have the interesting problem of representing complex schedule data in a database. I need to be able to represent the entirety of what the iCalendar (ics) format can represent, but in my database.
I don't care about insertion efficiency but query efficiency is critical. The operation I will be doing most often is providing either a single date/time or a date/time range, and trying to determine if the defined schedule matches any part of the date/time range. Other operations can be slower.
For those unfamiliar, ics allows representation of a single event or a reoccuring event based on multiple times per day, days of the week, week of a month, month, year, or some combination of those. For example, the third Thursday in November, or the 25th of December, or every two weeks starting November 2nd and continuing until September the following year.
Any suggestions?
© Stack Overflow or respective owner