Changes between Initial Version and Version 1 of Ticket #19441


Ignore:
Timestamp:
Dec 7, 2012, 11:10:19 AM (12 years ago)
Author:
Claude Paroz
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #19441 – Description

    initial v1  
     1{{{
    12class Species(models.Model):
    23    scientific_name = models.CharField(max_length=200, db_index=True)
     4}}}
    35
    4 Genererates 2 indexes
    5 
     6Generates 2 indexes:
     7{{{
    68BEGIN;
    79CREATE INDEX "species_species_scientific_name" ON "species_species" ("scientific_name");
     
    911
    1012COMMIT;
     13}}}
    1114
     15{{{
    1216class Species(models.Model):
    1317    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:
    1420
    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);}}}
    1822
    1923to make sure Postgres is optimized for LIKE operator.
Back to Top