Hi.
When I use a SlugField in a model,
an index for this field is create in postgres.
Why ?
(config : django 0.96 / postgresql )
A++ Xav.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFGH2rD4dg3EDuiPUcRAgmZAJ9qSsRXPZALQ51L0eX67EtAivxl3wCfQARH
/lI6QD8Rxn9MXU5LPfAvxiM=
=+Ssi
-----END PGP SIGNATURE-----
Indexing a fields makes searches over that field faster. Slug fields
are the very definition of a searchable, indexable field - the most
common use case for a Slug is as part of a URL scheme. So, Django
installs an index for each Slug field by default.
Yours,
Russ Magee %-)
Thx for your clarification.
Russell Keith-Magee a écrit :
> Indexing a fields makes searches over that field faster. Slug fields
> are the very definition of a searchable, indexable field - the most
> common use case for a Slug is as part of a URL scheme. So, Django
> installs an index for each Slug field by default.
Marc Fargas Esteve a écrit :
> Maybe because there is a high change that you will try to find rows
> based on this SlugField, so in common cases this INDEX will be nice.
> Also it's documented on
> http://www.djangoproject.com/documentation/model-api/#slugfield that
> this field has an implicit db_index=True, BUT you can always pass
> db_index=False if you do not want the index.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFGH34B4dg3EDuiPUcRAhYrAJsFy3fyk2AAhRGd016SGamx7v6TjgCeIM2u
bv9jLPy2XNQgK4JHUG2ARBo=
=VEHH
-----END PGP SIGNATURE-----