Add db_index to FlatPages 'url' field
|Reported by:||Owned by:||Adrian Holovaty|
|Cc:||dev@…||Triage Stage:||Ready for checkin|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Currently the FlatPage model doesn't have an index on 'url', but always uses 'url' for the lookup in contrib.flatpages.views:
f = get_object_or_404(FlatPage, url__exact=url, sites__id__exact=settings.SITE_ID)
I'm not sure how this could hurt in any case since if you only had a few flatpages your index would be small and if you had many it would be crucial.