Changes between Initial Version and Version 1 of Ticket #19441
- Timestamp:
- Dec 7, 2012, 11:10:19 AM (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #19441 – Description
initial v1 1 {{{ 1 2 class Species(models.Model): 2 3 scientific_name = models.CharField(max_length=200, db_index=True) 4 }}} 3 5 4 Gener erates 2 indexes5 6 Generates 2 indexes: 7 {{{ 6 8 BEGIN; 7 9 CREATE INDEX "species_species_scientific_name" ON "species_species" ("scientific_name"); … … 9 11 10 12 COMMIT; 13 }}} 11 14 15 {{{ 12 16 class Species(models.Model): 13 17 scientific_name = models.CharField(max_length=200, unique=True, db_index=True) 18 }}} 19 ...does not create any indexes, because it depends on UNIQUE, but it SHOULD generate the index: 14 20 15 Does not create any indexes, because it depends on UNIQUE, but it SHOULD generate the index 16 17 CREATE INDEX "species_species_scientific_name_like" ON "species_species" ("scientific_name" varchar_pattern_ops); 21 {{{CREATE INDEX "species_species_scientific_name_like" ON "species_species" ("scientific_name" varchar_pattern_ops);}}} 18 22 19 23 to make sure Postgres is optimized for LIKE operator.