时间日历数据结构 [英] Time Calendar Data Structure

查看:158
本文介绍了时间日历数据结构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在考虑更新(重写)我们的系统,该系统存储有关人们可以在白天预订房间等的信息。现在我们将一个表中的开始时间和房间的日期存储在另一个表中,另外我们存储个人约会时间。

We are looking at updating (rewriting) our system which stores information about when people can reserve rooms etc. during the day. Right now we store the start and time and the date the room is available in one table, and in another we store the individual appointment times.

从表面上看,这似乎是以这种方式存储信息的逻辑思想,但是随着时间的推移和系统的负担沉重,我们开始意识到这个数据结构似乎效率不高。 (这是搜索所有房间可用时间的密集型操作,并计算房间可用时间。如果房间可用于给定时间,则可用时间足以满足所请求的时间)。

On the surface it seemed like a logical idea to store the information this way, but as time progressed and the system came under heavy load, we began to realize that this data structure appears to be inefficient. (It becomes an intensive operation to search all rooms for available times and calculate when the rooms are available. If the room is available for a given time, is the time that it is available long enough to accommodate the requested time).

我们已经围绕如何使系统更有效率,我们认为必须有更好的方法来解决这个问题。有没有人有关于如何做这个的建议,还是有什么地方可以看看如何构建这样的东西?

We have gone around in circles about how to make the system more efficient, and we feel there has to be a better way to approach this. Does anyone have suggestions about how to go about this, or have any places where to look about how to build something like this?

推荐答案

我发现这本书对于涉及时间管理/约束的任何类型的数据库都是鼓舞人心的,必须阅读:

I found this book to be inspiring and a must-read for any kind of database involving time management/constraints:

在SQL中开发面向时间的数据库应用程序

由编辑者添加书籍可通过 Richard Snodgrass 在线提供这是一本好书。)

(Added by editor: the book is available online, via the Richard Snodgrass's home page. It is a good book.)

这篇关于时间日历数据结构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆