Ok, so I wanted to fire off an entry every day for 10 days.
Didn't make it.
Crud.
So we try again.
I think it had something to do with the fact that my designated timeframe was a whopping 15 minutes (yes, I really am that naive sometimes) at the end of the day. Logically, it made sense because I'd be able to reflect on what I'd learned for the day. Practically, it meant that either my brain was fried or I was in a groove and didn't want to get out.
Well, that or I'd start on a post (I have one half completed) that'd go on. And on. And on. And I'd realize that for it to be a high quality post I'd have to put more time into researching my wild generalizations and casual proclamations.
Hmm.
Maybe a shorter, more doable goal. Instead of subtly thinking I'm going to deliver a highly polished .net 2.0 tutorial on whatever-the-heck-I-found-out that day, perhaps just two paragraphs. Just...two.
And if I only do one, so be it.
So what have I learned the last week?
Storing hierarchical data in a sql database isn't straightforward. I started off with what's called an "adjacency list" model. (I found that out when it blew up) That's essentially where each row of the relationship table stores the childID and the parentID (and the child name, in my case).
There is an extremely elegant way to parse this. Unfortunately, it's recursive. With ~ 100 rows it returned lickety split. With about 500 rows it ran the sql server's (unlimited) connection pool out of connections.
Ow.
Err.
Yeah.
So back to the drawing board. There's one called "modified tree order traversal". After drawing it out on paper, I think I got my head around it. But it's a little bit more work (?!!) when inserting and deleting nodes.
Not sure what to do at this point. I want a quick and easy solution (don't we all!) I'm not dealing with millions of rows of data (more like about 3-4000). So I think I'll need to do some more thinking.
Tuesday, October 30, 2007
Subscribe to:
Post Comments (Atom)

0 comments:
Post a Comment