On Tue, Feb 16, 2010 at 4:43 AM, Greg Brown wrote:
> Ok, here goes:
>
> First, some background - UserProfile is the
> settings.AUTH_PROFILE_MODULE and the Application model has a
> ForeignKey to User. There's ~90,000 users/userprofiles, ~110,000
> applications (most have only one application, some
That's a good point, but then the ird_number field (on UserProfile) is
inaccessible. I'd need to do something like
User.objects.values('first_name', 'last_name', 'pk',
'userprofile__ird_number').annotate(
Max('application__creation_date'),
).order_by('-application__creation_date__ma
On Mon, Feb 15, 2010 at 1:43 PM, Greg Brown wrote:
> The queryset giving the problem is
>
> UserProfile.objects.values(
> 'ird_number', 'user__first_name', 'user__last_name', 'user__pk',
> ).annotate(
> Max('user__application__creation_date'),
> ).order_by('-user__application__
Ok, here goes:
First, some background - UserProfile is the
settings.AUTH_PROFILE_MODULE and the Application model has a
ForeignKey to User. There's ~90,000 users/userprofiles, ~110,000
applications (most have only one application, some have 2). The
database is mysql. If that's not enough info, let
On Mon, Feb 15, 2010 at 6:30 AM, Greg wrote:
> I have a large-ish query which is taking ~10 seconds to run, but I can
> get it down to less than a second by changing the group by part of the
> query from
>
> GROUP BY `refunds_userprofile`.`ird_number` ,
> `auth_user`.`first_name` , `auth_user`.
On Feb 14, 10:30 pm, Greg wrote:
> I have a large-ish query which is taking ~10 seconds to run, but I can
> get it down to less than a second by changing the group by part of the
> query from
>
> GROUP BY `refunds_userprofile`.`ird_number` ,
> `auth_user`.`first_name` , `auth_user`.`last_name`
I have a large-ish query which is taking ~10 seconds to run, but I can
get it down to less than a second by changing the group by part of the
query from
GROUP BY `refunds_userprofile`.`ird_number` ,
`auth_user`.`first_name` , `auth_user`.`last_name` ,
`refunds_userprofile`.`user_id` , `auth_us
7 matches
Mail list logo