OBS - Database schema has changed! If you use south, you need to run manage.py migrate!

This adds db indexing on a set of important database fields, all in the interest of optimization.
This commit is contained in:
Griatch 2012-02-06 13:18:25 +01:00
parent b87f787c38
commit 42d502bfc6
8 changed files with 480 additions and 8 deletions

View file

@ -63,7 +63,7 @@ class Alias(SharedMemoryModel):
is so as to allow for effective global searches also by
alias.
"""
db_key = models.CharField('alias', max_length=255)
db_key = models.CharField('alias', max_length=255, db_index=True)
db_obj = models.ForeignKey("ObjectDB", verbose_name='object')
class Meta:
@ -168,13 +168,13 @@ class ObjectDB(TypedObject):
# The location in the game world. Since this one is likely
# to change often, we set this with the 'location' property
# to transparently handle Typeclassing.
db_location = models.ForeignKey('self', related_name="locations_set",
db_location = models.ForeignKey('self', related_name="locations_set",db_index=True,
blank=True, null=True, verbose_name='game location')
# a safety location, this usually don't change much.
db_home = models.ForeignKey('self', related_name="homes_set",
blank=True, null=True, verbose_name='home location')
# destination of this object - primarily used by exits.
db_destination = models.ForeignKey('self', related_name="destinations_set",
db_destination = models.ForeignKey('self', related_name="destinations_set", db_index=True,
blank=True, null=True, verbose_name='destination',
help_text='a destination, used only by exit objects.')
# database storage of persistant cmdsets.