构建数据集市时,您每年使用一张表吗?数据库管理系统
我们每年存储大约 5 到 1000 万个事件,现在构建了一个将运营数据分开的数据集市。我的问题:
- 您是否会移动特定年份记录的事件并将其存储 在数据集市中删除“事件表”并重新开始?
- 每年创建一个新表,用于存储某一年的事件 给定年份,即
INSERT INTO 2011_actionrecord action
= '发生了什么'等INSERT INTO 2012_actionrecord 操作
= '发生了什么'等。 - 或者做其他事情?
非常感谢
We are storing about 5 to 10 million events each year and now build a datamart that separates operational data out. My question:
- Would you move the logged events from a given year and store it
in a data mart than delete the "event table" and start all over? - Create a new table for each year where you store the events for a
given year i.e.INSERT INTO 2011_actionrecord action
=
'whathappened' etc.INSERT INTO 2012_actionrecord action
=
'whathappened' etc. - Or do something else?
Thanks much
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
1) 一旦记录的事件“过期”,将其从事务数据库移至数据集市;这通常发生在“滚动”期间(因此,您实际上可能希望每月或以更高的周期删除一些内容)。将它们添加到数据集市(包括任何必要的转换),并从初始表中删除相关记录。不必费心删除表和索引(尽管您可能希望手动刷新索引)。
2)使用分区,正常查询(并插入)表: MySQL 分区
1) Move the logged events from the transactional database to the datamart once it has 'expired'; this usually takes place over a 'rolling' period (so, you probably actually want to remove things monthly, or at a higher cycle). Add them to the datamart (including whatever are the necessary transformations), and delete the relevant records from the initial table. Don't bother deleting the table and indicies (although you may wish to manually refresh the indicies).
2) Use a partition, query (and insert to) the table as normal: MySQL Partitions