Opened 11 years ago
Closed 11 years ago
#21986 closed Cleanup/optimization (fixed)
The documentation provides no indication as to why you might want to use indexes
Reported by: | Owned by: | bbaja42 | |
---|---|---|---|
Component: | Documentation | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | django-issues@… | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | yes |
Easy pickings: | yes | UI/UX: | no |
Description
Indexing is not an inherently straightforward and intuitive concept. There's plenty of material out there that suggests where you might want to apply database indexes, but the Django documentation doesn't suggest *anything*. Database access optimization suggests that it is a number one priority, and that you should use the information you have gleaned from profiling to decide what to index, but provides no methodology for applying that information. It's left to the reader's imagination to decide if they should add indexes to fields they read a lot or fields they change a lot or fields they do lookups by a lot or fields that have fish puns in their names.
I'd make some suggestions, but I am not qualified enough to write anything I'd be at all confident in.
Change History (7)
comment:1 by , 11 years ago
Triage Stage: | Unreviewed → Accepted |
---|---|
Type: | Uncategorized → Cleanup/optimization |
comment:2 by , 11 years ago
Cc: | added |
---|
comment:3 by , 11 years ago
comment:4 by , 11 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:5 by , 11 years ago
Has patch: | set |
---|---|
Patch needs improvement: | set |
As noted on the PR, I think we can probably do a bit better than just a link to Wikipedia's entry on database indexes. I wouldn't want to go into too much detail since indexing is a complex topic and is often database dependent, but some idea of where to start looking would be helpful.
comment:6 by , 11 years ago
I've expanded upon the previous pull request to also document a rule-of-thumb (use indexes to speed up lookups). I have added your caveats on the topic of indexes, but this should be enough to point readers in the right direction.
comment:7 by , 11 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Created pull request https://github.com/django/django/pull/2252