当前位置:  开发笔记 > 前端 > 正文

嵌套间隔是嵌套集(修改的预订遍历)RDBMS性能降级的可行解决方案吗?

如何解决《嵌套间隔是嵌套集(修改的预订遍历)RDBMS性能降级的可行解决方案吗?》经验,为你挑选了1个好方法。

在Joe Celko的嵌套集(修改的预订遍历)的已知限制中,随着树变大到大,性能上的标记会降低.

Vadim Tropashko提出了嵌套区间,并在本文中提供了示例和理论解释:http://arxiv.org/html/cs.DB/0401014

这是一个可行的解决方案,是否有任何可行的示例(使用任何语言)从原生数据库层抽象出来?



1> Chris..:

While I've seen examples for nested sets, I haven't seen much for nested intervals, although in theory it shouldn't be difficult to convert from one to the other. Instead of doing pre-order traversal to label the nodes, do a breadth-first recursion. The trick is to work out the most efficient way of labelling n children of a node. Since the node between a/b and c/d is (a+c)/(b+d), an ill-conditioned insert (for instance, inserting the children left to right), runs the risk of creating the same exponential growth in the index values as, for instance, using a full materialized path. It is not difficult to counteract this effect - create the new indexes one at a time, inserting each at the location that produces the lowest resulting denominator.

就性能下降而言,很大程度上取决于您打算执行的操作.仍然有一些操作需要对整个树进行完全重新标记 - 嵌套集或嵌套间隔方法都适用于很少更改的结构.如果对层次结构进行了大量的结构更改,则"标准"父子表结构可能更容易使用.还要记住,嵌套集的整数标记比间隔方法更容易一些操作(例如后代数).

推荐阅读
李桂平2402851397
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有