Question

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.

Was it helpful?

Solution

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.

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top