﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
19441	No Postgres _like index when unique=True	dylan@…	nobody	"class Species(models.Model):
    scientific_name = models.CharField(max_length=200, db_index=True)

Genererates 2 indexes

BEGIN;
CREATE INDEX ""species_species_scientific_name"" ON ""species_species"" (""scientific_name"");
CREATE INDEX ""species_species_scientific_name_like"" ON ""species_species"" (""scientific_name"" varchar_pattern_ops);

COMMIT;

class Species(models.Model):
    scientific_name = models.CharField(max_length=200, unique=True, db_index=True)

Does not create any indexes, because it depends on UNIQUE, but it SHOULD generate the index

CREATE INDEX ""species_species_scientific_name_like"" ON ""species_species"" (""scientific_name"" varchar_pattern_ops);

to make sure Postgres is optimized for LIKE operator."	Bug	new	Database layer (models, ORM)	1.5-beta-1	Normal				Unreviewed	0	0	0	0	0	0
