Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

SQL

Name: Anonymous 2008-10-21 19:39

I often have to store hierarchies of data to a SQL database. Is there a more efficient method other than an adjacency list (Records have parent columns to store their relationships). It is fine for somethings. But is there a more complete and better way? Is there a viable alternative?

Name: Anonymous 2008-10-21 19:45

Not sucking at modelling data is a good way.

Name: Anonymous 2008-10-21 19:55

Yeah, it's called not using SQL. Store everything as sex peas and then write a sex-pea parser to load them back in.

Name: Anonymous 2008-10-21 20:06

>>2

Thanks for your reply buddy. Can you give me an alternative to storing a hierarchy that isn't a hierarchy, but has all the features of a hierarchy.

I do know as you do, that nothing should ever be modeled as a hierarchy.

Name: Anonymous 2008-10-21 20:14

>>4
He's not your buddy, pal.

Name: Anonymous 2008-10-21 22:57

Nested sets are awesome for certain kinds of usage. But you already knew that, or at least you could have if you'd spent half a minute on Google.

Name: Anonymous 2008-10-22 8:53

>>5
He's not your pal, friend.

Name: Anonymous 2008-10-23 15:01

>>7
You're not my friend, fag.

Name: Anonymous 2008-10-23 15:10

>>1
I don't think there's a reasonable way to represent that kind of data within SQL. For a project that came through my office where we *had* to serialize the data into SQL rows (due to project constraints) we just used adjacency lists and cached the ancestors and descendants of each node in an extra blob column.

Total hack, but it got the job done.

Name: Anonymous 2008-10-23 15:27

>>8
We prefer the term "homosexual", buddy.

Name: Anonymous 2008-10-23 16:08

>>10
I'm not your buddy, homosexualfag

Name: Anonymous 2008-10-23 16:36

ORDB

Name: Anonymous 2008-10-23 20:30

>>8
You're not me, homophobe.

Name: Anonymous 2008-10-23 23:03

>>13
I'm not the Sussman, transgender.

Name: Anonymous 2008-10-23 23:39

This thread sucks.
Please, stop posting.

Name: Anonymous 2008-10-24 11:41

>>15
If we stopped posting in all threads just because they sucked, this board would be dead.

Name: Anonymous 2008-10-24 21:11

>>3

With your parser, how do you propose searching two million records? Sequentially?
Fail.

Name: Anonymous 2010-12-25 20:41


Don't change these.
Name: Email:
Entire Thread Thread List