Make personas pages faster by adding indexes

This commit is contained in:
Wil Clouser 2010-06-01 10:35:14 -07:00
Родитель 65ab1dbb6a
Коммит cfb5d44043
2 изменённых файлов: 5 добавлений и 2 удалений

Просмотреть файл

@ -413,8 +413,8 @@ class Persona(caching.CachingMixin, models.Model):
submit = models.DateTimeField(null=True)
approve = models.DateTimeField(null=True)
movers = models.FloatField(null=True)
popularity = models.IntegerField(null=False, default=0)
movers = models.FloatField(null=True, db_index=True)
popularity = models.IntegerField(null=False, default=0, db_index=True)
license = models.ForeignKey('versions.License', null=True)
objects = caching.CachingManager()

Просмотреть файл

@ -0,0 +1,3 @@
-- Make personas queries faster
CREATE INDEX `personas_movers_idx` ON personas (movers);
CREATE INDEX `personas_popularity_idx` ON personas (popularity);