patternsqlMinor
Anybody using HierarchyId in production? Is it reliable?
Viewed 0 times
reliableproductionhierarchyidusinganybody
Problem
Is anybody using HierarchyId in real production with tables of reasonable size, more than a few thousand rows? Is it reliable/performant? So far I have not found anyone not affiliated with the vendor recommend it, and Paul Nielsen advises against it here.
What is your experience with using HierarchyId in actual production systems?
Which criteria have you used when you were choosing HierarchyId over its alternatives?
What is your experience with using HierarchyId in actual production systems?
Which criteria have you used when you were choosing HierarchyId over its alternatives?
Solution
I've implemented HierarchyID and found it to provide good performance and easy to use.
I've used it on relatively small datasets (tens of thousands of rows) with hierarchy up to 10 branches deep.
Why use it? The HierarchyID type provides a number of helper methods (such as
Paul Nielsen's comment over on StackOverflow is confusing to me - the HierarchyID is a materialized path. I'm more inclined to agree with this comment below his answer.
A better question might be 'why not use it'. It's easy to use, provides a lot of functionality that you'd otherwise be writing for yourself, and performs well (in my limited tests).
I've used it on relatively small datasets (tens of thousands of rows) with hierarchy up to 10 branches deep.
Why use it? The HierarchyID type provides a number of helper methods (such as
IsDescendantOf) that make your job easier than rolling your own materialized path.Paul Nielsen's comment over on StackOverflow is confusing to me - the HierarchyID is a materialized path. I'm more inclined to agree with this comment below his answer.
A better question might be 'why not use it'. It's easy to use, provides a lot of functionality that you'd otherwise be writing for yourself, and performs well (in my limited tests).
Context
StackExchange Database Administrators Q#17302, answer score: 9
Revisions (0)
No revisions yet.