473,509 Members | 3,543 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Modelling large trees in SQL Server

We are currently in the process of developing a client/server based
generic tree application with which we want to be able to model and
render any size, shape and depth of tree.

Our primary objective is to provide the ability to model large data
trees with some 20 million+ nodes whilst still allowing adequate
rendering and query times from the client.

We have just bought Joe Celko's "Tree's and Hierarchies in SQL fo
Smarties" and have picked up some very useful tips.

We are definitely looking at using some hybrid model but are undecided
as to what combination would suit us best.

Whilst constructing the tree we have the following information
available to us, that we could/may include in our database structure:

1) The Node's parent.
2) The Node's depth/level.
3) The Node's path to the root node.
4) The Node's child nodes count.
5) The Node's descendant nodes count.
6) The Node's position relative to it's sibling nodes.

This infomation would allow us to combine many of the models Joe Celko
discusses, including:

1) The Nested Sets/Interval model - allows us to quickly find
subtrees.
2) The Adjacency List model - allows us to quickly find immediate
child nodes.
3) The Materialized Path model - allows us to quickly find the
ancestors of the node.
4) The Depth Model - allows us to quickly find nodes related to their
levels/depth.

It is also quite likely that we will want to change the structure of
the tree fairly frequently. As an indication, I can see update rates
of every 15 minutes or less.

To us, disk space and hardware are cheap, so we are not concerned with
storage overhead. We just need optimal query performance.

Types of queries we need are for example:

Given a node...
1) Get it's immediate children.
2) Get it's ancestors.
3) Get all of it's descendants.
4) Get it's descendants to a certain depth.
5) Get it's siblings
etc. etc.

Any suggestions/foresight/tips that may help us in the database
modelling would be most appreciated?
Jul 20 '05 #1
0 1280

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2048
by: geoff | last post by:
Has anyone used process modelling successfully and what do you think of it? Process modelling as opposed to say, collaborating objects to get a task done (I know the process model itself could be a...
0
1028
by: zeroSpaMISBaDtype | last post by:
Hi, A friend of mine at Newcastle University is looking to get in touch with someone doing numerical modelling in C++ (preferably, but not essentially, using DEAL 2. To be honest, I think he'd...
0
1107
by: yasaswi | last post by:
What are the two best database modelling solutions for MySQL database? I use AllFusion Erwin Data Modeller, but this tool from Computer Associates does not have MySQL option in it. Thereby I have...
1
485
by: barnesc | last post by:
Hi again, Since my linear algebra library appears not to serve any practical need (I found cgkit, and that works better for me), I've gotten bored and went back to one of my other projects:...
2
1517
by: Julian North | last post by:
Hi, I am in the process of porting a number of large MSSQL databases to Postgres. The current id generation model in SQL server is an oracle style sequence generator i wrote using a pretty...
3
1594
by: David Svoboda | last post by:
I have a server program that takes commands and acts on them. The server program can also take these commands from an input file or standard input (mainly for testing purposes). As such, I often...
3
2473
by: vicky | last post by:
Hi All, Can u please suggest me some books for relational database design or database modelling(Knowledgeable yet simple) i.e. from which we could learn database relationships(one to many,many to...
4
2713
by: raidvvan | last post by:
Hi there, We have been looking for some time now for a database system that can fit a large distributed computing project, but we haven't been able to find one. I was hoping that someone can...
0
7237
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7137
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
7073
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7506
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5656
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4732
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3207
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
779
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
443
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.