[sqlalchemy] Re: Hierachical data

2007-08-05 Thread Arnar Birgisson
On 8/5/07, Alexandre CONRAD [EMAIL PROTECTED] wrote: As Michael pointed out, the ElementTree example stores the XML data en-masse, so if you don't need those kind of queries, you might see better performance and a simpler way of life if you just serialize the ElementTree instances to XML

[sqlalchemy] Re: Hierachical data

2007-08-04 Thread Alexandre CONRAD
Alexandre CONRAD wrote: Ok, maybe I got influenced by articles about nested sets beeing better, as pointed Mike. Now I got you guys advices, I'll look deeper into adjacency list. I'm glad I've had such feedback on my problem. This defenitly helps, even more when you just don't know from

[sqlalchemy] Re: Hierachical data

2007-08-04 Thread Michael Bayer
On Aug 4, 2007, at 7:43 AM, Alexandre CONRAD wrote: Alexandre CONRAD wrote: Ok, maybe I got influenced by articles about nested sets beeing better, as pointed Mike. Now I got you guys advices, I'll look deeper into adjacency list. I'm glad I've had such feedback on my problem. This

[sqlalchemy] Re: Hierachical data

2007-08-04 Thread Alex Conrad
Hi again, On Aug 4, 5:41 pm, Michael Bayer [EMAIL PROTECTED] wrote: snip no, youre free to order by whatever crierion youd like. the examples return the nodes in insert order and will duplicate the input document. snip you can order by whatever you like. the example is ordering in the

[sqlalchemy] Re: Hierachical data

2007-08-04 Thread Michael Bayer
On Aug 4, 2007, at 5:52 PM, Alex Conrad wrote: The XML I showed was just an example to illustrate my problem. Sorry if this was confusing. Right now, I have an application that uses XML, it's true, but I'm rewriting the whole application. I had a feeling this was the case, but I just try to

[sqlalchemy] Re: Hierachical data

2007-08-03 Thread Marco Mariani
Alexandre CONRAD ha scritto: Maybe this should need some attention to implement in SA some API to handle nodes (insert, move, remove) of herachical trees in SA the Nested Set way. There are several ways to implement schema and rules (and therefore APIs) just by looking at Celko's

[sqlalchemy] Re: Hierachical data

2007-08-03 Thread Michael Bayer
First of all, for your example here, youre just storing small subtrees of hierarchical data, and youre not trying to query complex set operations over the entire set of nodes. Nested sets is completely disadvantageous in this case for its complexity, its incompatibility with row-based

[sqlalchemy] Re: Hierachical data

2007-08-03 Thread Alexandre CONRAD
Arnar Birgisson wrote: If I understand correctly the OP has a need to store a set of hierarchical Nodes. Only that some node types (video, image) can't have children while others can (group, media_list). Correct, group and media_list will have childen. I'm also going to integrate a playlist

[sqlalchemy] Re: Hierachical data

2007-08-03 Thread Arnar Birgisson
On 8/3/07, Alexandre CONRAD [EMAIL PROTECTED] wrote: The nested looks more efficient. But, things are still a little confused in my head. I need to well put down the pros and cons of each technic for my needs. I was using XML and I'm now switching to a flat database with technics I've never

[sqlalchemy] Re: Hierachical data

2007-08-03 Thread Alexandre CONRAD
Ok, maybe I got influenced by articles about nested sets beeing better, as pointed Mike. Now I got you guys advices, I'll look deeper into adjacency list. I'm glad I've had such feedback on my problem. This defenitly helps, even more when you just don't know from where to start. Also these

[sqlalchemy] Re: Hierachical data

2007-08-03 Thread Arnar Birgisson
On 8/3/07, King Simon-NFHD78 [EMAIL PROTECTED] wrote: I think of adjacency lists and nested sets as more about hierarchies of a single type of object (imagine trying to represent a family tree with a row for each Person). I don't really think they're relevant in this case. If I understand

[sqlalchemy] Re: Hierachical data

2007-08-03 Thread King Simon-NFHD78
Hi, I think this is a pretty good match for Joined Table polymorphic inheritance, as described in the docs http://www.sqlalchemy.org/docs/adv_datamapping.html#advdatamapping_inhe ritance_joined. Your nodes_table would correspond to the employees table, and the 'subclass' tables such as video