cfStarlight
Technical User
I need to build a type of 'virtual' folder structure in a database table. Like windows explorer, but table driven. The physical files will be stored on disk, but the tree (or hierarchy) will be stored in a db table. It will contain a a fair amount of data.
I've been reading about several methods for representing this type of tree:
1 nested sets model
2 adjacency model
3 materialized path
Each seems to have pros and cons. I don't have much experience with them, but my concerns are:
1 Nested sets::: Concerned about blocking since node changes require updating the entire table
2 Adjacency model::: MS SQL 2000 does not support CTE's. So retrieving an entire branch involves looping which may be slow or resource intensive.
3 Materialized path::: Looks like a possibility. But would require a large varchar column to store the path. Afaik, MS SQL 2000 does not support indexes on large varchar columns so I'm concerned about query performance.
Any suggestions, advice, real life experiences (or even horror stories
that might help me in choosing one of these models?
I've been reading about several methods for representing this type of tree:
1 nested sets model
2 adjacency model
3 materialized path
Each seems to have pros and cons. I don't have much experience with them, but my concerns are:
1 Nested sets::: Concerned about blocking since node changes require updating the entire table
2 Adjacency model::: MS SQL 2000 does not support CTE's. So retrieving an entire branch involves looping which may be slow or resource intensive.
3 Materialized path::: Looks like a possibility. But would require a large varchar column to store the path. Afaik, MS SQL 2000 does not support indexes on large varchar columns so I'm concerned about query performance.
Any suggestions, advice, real life experiences (or even horror stories