Saturday, April 21, 2012

Re: Automatic indexes on foreign keys

On Sun, Mar 25, 2012 at 9:30 AM, Aryeh Leib Taurog <vim@aryehleib.com> wrote:
>
> On Mar 23, 3:56 pm, Javier Guerra Giraldez <jav...@guerrag.com> wrote:
> > On Fri, Mar 23, 2012 at 4:37 AM, Aryeh Leib Taurog <v...@aryehleib.com>
> > wrote:
> >
> > > My understanding is that one usually
> > > wants an index on the *referenced* field, not the *referencing*
> > > field.
> >
> > it's for the back-reference link.  so that you can do
> > group.item_set.all() and get all the items that share a group.
>
> Ah, okay.  Yes, this would definitely improve performance of that
> query.  But why the second index (varchar_pattern_ops in postgresql)?

See this ticket

https://code.djangoproject.com/ticket/12234

and the commit that fixed it:

https://code.djangoproject.com/changeset/11912

--
Ramiro Morales

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate