On Dec 26, 2008, at 5:08 AM, Wichert Akkerman wrote:
> > It did not though: I only got the direct parent. if you could save me some time and post a full example that I can run that would be helpful. > > >> To roll those up into a >> single set of result columns in a single SQL statement would be very >> involved - a recursive iterator would be way easier, i.e. >> >> @property >> def parents_iterator(self): >> s = self.parent >> while s: >> yield s >> s = s.parent >> > > that suggests that join_depth the other way (recursive children) is > also expensive, which the documentation does not mention. Is that > correct? join_depth is expensive, because joins are expensive. You have to use this option judiciously based on the kind of data in your tables and the kind of queries you are emitting. Its also not the only way to get a recursive eager join - the eagerload() option will have the same effect on a manual basis. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---
