Thanks a lot for the tips! I think I'll go for the custom merging in Python.
One stupid question. Is there any estimation as to when queryset- refactor might be merged to trunk? I know it's hard to answer, but should it be more like 1 month, 6 month, 1 year away? :) The wiki says it's pretty unstable, so I guess it won't happen before a while... Thanks! On Feb 12, 4:02 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Mon, 2008-02-11 at 01:03 -0800, Julien wrote: > > Hi, > > > Here's the SQL code: > > > SELECT > > `projects_project`.`id`,`projects_project`.`name`,`projects_project`.`created_by_id`, > > FROM `projects_project` INNER JOIN `projects_participant` AS > > `projects_project__participants` > > ON `projects_project`.`id` = > > `projects_project__participants`.`project_id` > > WHERE ((`projects_project`.`created_by_id` = 1 OR > > `projects_project__participants`.`user_id` = 1)) > > Since the link from Project to Participants (in that direction) can be > empty, the join there should really be a LEFT OUTER join. This is one of > those bugs that occurs with "or" joins sometimes and is one of the > reason they've been heavily rewritten on the queryset-refactor branch. > Basically, if one of the querysets could be empty when there are results > in the other queryset, you sometimes see problems. This is one of those > cases. > > All I can suggest is waiting a little while until queryset-refacotor is > merged into trunk (if you're really brave, you could try running against > the branch, but I haven't really declared it ready for testing yet). In > the meantime, pull the two querysets back into Python and merge the > lists there. Unless you're pulling back hundreds of thousands of > results, you won't notice any real speed difference. > > Regards, > Malcolm > > -- > Depression is merely anger without > enthusiasm.http://www.pointy-stick.com/blog/ --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---