missing_indexes
Scans Django source code to detect fields used for filtering or sorting that lack database indexes, reporting occurrence counts so you can decide where to add indexes before shipping.
Instructions
Fields the code filters or sorts on that carry no index.
Runtime tools answer this by watching real traffic, which only ever covers
the paths traffic reached. Reading the source covers every path in the
repository, works with no database and no traffic, and can run on a branch
before it ships.
The trade is that it cannot weigh anything: a filter on a forty row table
looks like one on a forty million row table. It reports where an index is
missing and how often the code asks for it, and leaves the decision to
somebody who knows the row counts.
Args:
search_path: directory to scan. Defaults to the project path.
min_occurrences: only report a field asked for at least this often.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| search_path | No | ||
| min_occurrences | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||