Changes between Initial Version and Version 24 of Ticket #22125


Ignore:
Timestamp:
10/30/2018 01:29:34 PM (2 years ago)
Author:
Tim Graham
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #22125

    • Property Cc emorley@… Phil Krylov added
    • Property Patch needs improvement set
    • Property Keywords db-indexes added
    • Property Version changed from 1.6 to master
    • Property Easy pickings unset
    • Property Owner changed from nobody to bwreilly
    • Property Has patch set
    • Property Triage Stage changed from Unreviewed to Accepted
  • Ticket #22125 – Description

    initial v24  
    11Suppose I have the following model:
     2{{{
    23class Food(models.Model):
    34  restaurants = models.ManyToManyField(Restaurant)
    4 
     5}}}
    56The following table is created:
    6 
     7{{{
    78CREATE TABLE "main_food_restaurants" (
    89    "id" integer NOT NULL PRIMARY KEY,
     
    1112    UNIQUE ("food_id", "restaurant_id")
    1213)
    13 
     14}}}
    1415and the indexes:
    15 
     16{{{
    1617CREATE INDEX "main_food_restaurants_0899c464" ON "main_food_restaurants" ("food_id");
    1718CREATE INDEX "main_food_restaurants_be4c8f84" ON "main_food_restaurants" ("restaurant_id");
    18 
    19 Notice that  the single index on food_id is not needed due to the unique index (food_id, restaurant_id)
     19}}}
     20Notice that  the single index on food_id is not needed due to the unique index `(food_id, restaurant_id)`.
Back to Top