データベースに左右のツリーがありますが、これはパフォーマンスの問題です。parentIdとorderIdを持つシステムに切り替えます。
左右ツリーのノードのインデックスを取得できるSQLスクリプトを探しています。
データベースに左右のツリーがありますが、これはパフォーマンスの問題です。parentIdとorderIdを持つシステムに切り替えます。
左右ツリーのノードのインデックスを取得できるSQLスクリプトを探しています。
このような?
select COUNT(treestructureid)
from TreeStructures s,
(select leftvalue, rightvalue, treeid, ParentTreeStructureId from TreeStructures where TreeStructures.TreeStructureId = 204260)
as data
where s.LeftValue <= data.LeftValue and s.RightValue <= data.RightValue
and s.TreeId = data.TreeId and s.ParentTreeStructureId = data.ParentTreeStructureId