Hi,
I'd like to be able to specify what kind of index the database should use
for a particular field. I have a proof of concept branch that works with
PostgreSQL at https://github.com/zbenjamin/django/compare/index-types, but
I'd like to solicit opinions on whether there's a better way of doing it.
The way it works in my branch is that you specify the index type by making
the Field db_index argument a string containing the name of the index type
you'd like to use. Specifying db_index=True uses the default index type.
Example usage:
class IndexTest(models.Model):
unindexed = models.IntegerField(db_index=False)
default_indexed = models.IntegerField(db_index=True)
btree_indexed = models.IntegerField(db_index="btree")
hash_indexed = models.IntegerField(db_index="hash")
Zev
--
You received this message because you are subscribed to the Google Groups
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-developers.
For more options, visit https://groups.google.com/groups/opt_out.