#2350: ManyToManyField and db_index
---------------------------------------------+------------------------------
          Reporter:  Rudolph                 |         Owner:  nobody
            Status:  reopened                |     Milestone:        
         Component:  Database wrapper        |       Version:  SVN   
        Resolution:                          |      Keywords:        
             Stage:  Design decision needed  |     Has_patch:  0     
        Needs_docs:  0                       |   Needs_tests:  0     
Needs_better_patch:  0                       |  
---------------------------------------------+------------------------------
Changes (by [EMAIL PROTECTED]):

  * status:  closed => reopened
  * resolution:  wontfix =>

Comment:

 The problem here is that there is no way to create a ManyToManyField table
 with indexed columns. Because both fields of such a table are used in
 joins, this makes any usage of the table very slow.

 I agree that db_index on an intermediary table doesn't make much sense,
 but it's better than nothing.

 Possible solutions:
  * Make db_index=True create indexes on both foreign keys in the
 intermediary table.
  * Use a different argument to accomplish the same thing more explicitly,
 i.e. index_columns=True .
  * Implicitly create indexes on both the foreign keys.

 I prefer the second option since it's the most explicit.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/2350#comment:4>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" 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/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to