Calendar Time Data Structure

We are looking at updating (rewriting) our system, which stores information about when people can reserve numbers, etc. during the day. Right now we save the beginning and time and date when the room is available in one table, and in another we keep separate dates for the meeting.

At first glance, it seemed a logical idea to store information in this way, but as time progressed and the system was under heavy load, we began to realize that this data structure was ineffective. (This is an intensive operation of finding all rooms within available times and calculating when rooms are available. If a room is available for a certain time, this is the time when it is available long enough to satisfy the requested time).

We went around circles on how to make the system more efficient, and we feel that there should be a better way to get closer to this. Does anyone have any suggestions on how to do this, or are there places where you can see how to build something like this?

+3
source share
2 answers

I found this book inspiring and must-read for any database that includes time management / limitations:

Developing applications with a temporary database binding in SQL

(Added by editor: the book is available online through Richard Snodgrass . This is a good book.)

+4
source

@Radu094 - .

, ? " " ( , , , - ), " - " "". ( ) ( ).

" " ( , " ", "" " " ).

, . :

  • X Y T1 T2?
  • Y T1 T2?
  • Y X - ?
  • Day Y 12 ?
  • X Y?

. . . , [T1..T2), [T1 + 00: 01..T2-00: 01) . . Interval Algebra ( uci.edu).

+3

All Articles