On Mon, 2008-11-17 at 11:07 -0800, Gustavo Picón wrote: [...] > So the usual recommendation is: > > - if you're going to insert a lot more than you read, use adjacency > list > - if, as is the most common case, you're going to read your tree more > than you insert nodes, use nested sets or materialized path
Size matters, though. Your numbers are for a lot more than 500 nodes and I'll repeat my earlier claim that for something that small you just aren't going to lose a lot of performance (in fact, depending on what you're doing with the data, you'll often gain speed) by doing a naive select of almost everything (or everything restricted by parent name, say) and then just working Python. You cut out a bunch of database level comparisons at that point. Your benchmarks match what other people see with those various implementation strategies, so they look believable (and the comparisons between the various database engines look believable, too), so I think they're good measures, but at various ends of the scale (and, let's be serious here: 500 is small), alternative strategies work very well. Don't misunderstand me: I think treebeard is an interesting project and having multiple implementations is a good idea both for drop-in practicality and as reference code. I think it's great what you've done. Trees are a fascinating storage structure and there are lots of trade-offs involved in code complexity and performance (insert vs. different retrieval patterns vs number of nodes, for example), so anybody picking just one implementation is going to be disappointed at some point. (By the way, are those benchmark numbers averages for each run over the 1000 nodes, or totals for the "several times" that you did the retrievals?) Regards, Malcolm --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---