Changes between Initial Version and Version 1 of Ticket #22125, comment 2
- Timestamp:
- Jan 13, 2016, 3:52:39 PM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #22125, comment 2
initial v1 1 1 Let me clarify. 2 2 Suppose you have the following code: 3 3 {{{ 4 4 class B(models.Model): 5 5 pass … … 7 7 class A(models.Model): 8 8 b = models.ManyToManyField(B) 9 =========================== 9 }}} 10 10 11 11 The following SQL is produced: 12 12 13 13 {{{ 14 14 CREATE TABLE "main_b" ( 15 15 "id" integer NOT NULL PRIMARY KEY … … 29 29 CREATE INDEX "main_a_b_4d6cc2fb" ON "main_a_b" ("a_id"); 30 30 CREATE INDEX "main_a_b_2c14050b" ON "main_a_b" ("b_id"); 31 32 ============== 31 }}} 33 32 34 33 Note that the index on a_id is redundant due to the unique constraint on a_id, b_id