如何正确创建非规范化报告表?
因此,我们有运行的报告,我们的客户端每天运行多次,其中一些报告触及了我不喜欢的非常重要的表。
我们目前有一个小型报告表,当新用户注册时会填充该报告表。 用户注册并填充 aspnet_membership 表,然后运行另一个存储过程来填充报告表。
我注意到我们在注册过程中遇到了一些死锁,我想知道这是否是原因,尽管我不确定,因为它只是在执行插入操作,我认为这不会导致死锁。
无论如何,就创建报告表而言,最好只在 aspnet_membership 表上添加一个触发器,然后在插入新记录时将其插入报告表中,或者在初始注册时运行两个存储过程也可以吗?
我想过一个通宵的过程,但数据需要是实时的。
提前致谢!
So we have reports which run, that our client runs multiple times daily and some of these reports hit very important tables which I'm not a fan of.
We currently have a small reporting table which is populated when a new user signs up. The user signs up and the aspnet_membership table is populated, then another sproc is run to populate the reporting table.
I've noticed we get some deadlocks during the registration process and I'm wondering if this is the cause, though I'm not sure since it's just doing Inserts which I don't think would cause deadlocks.
Anyway, as far as creating a reporting table, would it be better to just add a trigger onto the aspnet_membership table and when a new record is inserted we insert into our reporting table, or is having two sprocs run upon initial registration fine too?
I thought about an overnight process but the data needs to be real time.
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这些报告至少可以接近实时吗? 您是否可以有一个每 5 分钟运行一次的 SQL 作业,也许可以填充报告表?
Could the reports at least be near real time? Could you have a SQL job that runs every 5 minutes perhaps that populates the reporting table?