On Fri, Sep 9, 2011 at 4:33 PM, Christophe Pettus <x...@thebuild.com> wrote: > > On Sep 9, 2011, at 6:28 AM, Pewpewarrows wrote: > >> prop_dates = >> Target.objects.annotate(latest_property=Max('property__export_date')).values_list('latest_property', >> flat=True) >> properties = Property.objects.filter(export_date__in=prop_dates) > > Note that if prop_dates has more than 10-15 entries, it's going to perform > badly (at least on PostgreSQL, and almost certainly on MySQL too). I think > this particular situation is definitely a .raw() opportunity.
Not sure I understand the limitation to 10-15 entries. Please explain? Or EXPLAIN? -- Simon Riggs http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- 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 django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.