物化路径模式 VS Hierarchyid
我正在阅读 SQL Server 2008 圣经,它说物化路径模式比 Hierarchyid 快得多。这是真的吗?我怎样才能使hierarchyid具有相同或更好的性能。
I am reading the SQL server 2008 bible and it says the materialized path pattern is significantly faster then the hierarchyid. Is this really true? How can I make the hierarchyid have equal or better performance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
本章介绍了设计和查询层次结构的三种方法:邻接对、物化路径和 HierarchyID。这是同一问题的三种解决方案,所以是的,比较这三种方法是非常有意义的。事实上,物化路径是最快的,但邻接对可以解决更多类型的层次结构问题。 HierarchyID 很笨拙,难以查询,而且,如果您遵循 MSFT 的建议,它只存储相对位置,而不存储键,因此它的稳健性较差。
The chapter explains three methods for designing and querying hierarchies: Adjacency Pairs, Materialized Path, and HierarchyID. These are three solutions to the same problem so yes, it makes perfect sense to compare these three methods. The truth is that Materialized path is the fastest but Adjacency Pairs can solve more types of hierarchy problems. HierarchyID is clumsy, difficult to query, and, if you follow MSFT’s recommendation, it only stores the relative position, not the key, so it’s less robust.
您的意思是物化路径与嵌套集还是?物化路径模式可以采用层次数据类型。比较模式与数据类型的速度是没有意义的。
Do you mean materialized path vs. nested sets or ? A materialized path pattern can employ a hiearchyid datatype. It doesn't make sense to compare the speed of a pattern vs a datatype.