NHibernate 和索引视图(物化视图)

发布于 2024-08-15 05:20:41 字数 318 浏览 3 评论 0原文

最近,我正忙于使用 NHibernate 实现分页功能,对于简单的实体,事情进展顺利,但是对于那些需要多个连接才能获取请求的页面的实体,我遇到了性能问题。除此之外,如果可以按照约定执行查询而不使用所有扭曲的别名和连接,那么实现会简单得多。

所以我想到了所谓的索引视图物化视图,它可以解决这两个问题(或至少是性能问题),但我找不到任何指南或信息如何使用 NHibernate 做到这一点?问题更加复杂,因为某些实体的数据更新/插入非常频繁,因此可能需要急于更新,这可能会导致性能问题。

有什么建议吗?

谢谢

Recently I was busy implementing paging functionality with NHibernate and things went smoothly with simple entities, but I hit a performance problem with those ones where multiple joins are required to acquire the requested page. Besides that, implementation would be much simpler if the queries could be performed by convention without using all the twisted aliases and joins.

So I thought of so called indexed views or materialized views, which could solve both issues (or at least the performance one), but I couldn't find any guide or information on how to do it with NHibernate? The problem is more complex, because data are updated/inserted quite often for some entities, so eager updating would probably be necessary which could be a performance problem.

Any advice?

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

郁金香雨 2024-08-22 05:20:41

我已经有一段时间没有提出这个问题了,但是......

“使用CQRS”将是一个不错的答案。使用它可以优雅地避免此类问题。

I's been a while since this question, however ...

"Use CQRS" would be a decent answer. Such problems can be elegantly avoided with using it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文