Django

Code

Ticket #13730 (closed: fixed)

Opened 3 months ago

Last modified 1 month ago

Allow db_index=False for ForeignKey

Reported by: Suor Assigned to: Suor
Milestone: Component: Database layer (models, ORM)
Version: 1.2 Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

Now db_index=True is hard-coded, so I have to drop unneeded indexes manually after syncdb or south migrate.

Rationalization:
Indexes slow down insert, update and delete operations, so it's ineffective to manage indexes that are not really used.
They may be not used if:
- they are created for consistency not for joins;
- there are partial, multiple column or other special indexes that would be used instead of them

Attachments

needs_context.diff (2.1 kB) - added by Suor on 06/10/10 03:17:36.
soft_db_index.diff (0.9 kB) - added by Suor on 06/10/10 03:18:38.

Change History

06/10/10 03:17:36 changed by Suor

  • attachment needs_context.diff added.

06/10/10 03:18:38 changed by Suor

  • attachment soft_db_index.diff added.

06/10/10 03:20:13 changed by Suor

  • needs_better_patch changed.
  • has_patch set to 1.
  • needs_tests changed.
  • needs_docs changed.

Sorry, first patch is for other issue.

06/16/10 04:06:07 changed by Suor

  • owner changed from nobody to Suor.

06/18/10 09:51:40 changed by russellm

  • stage changed from Unreviewed to Accepted.

06/21/10 21:06:55 changed by Suor

  • status changed from new to assigned.
  • stage changed from Accepted to Ready for checkin.

Promoting to ready for chekin since it's obvious bug

07/29/10 21:55:21 changed by russellm

  • status changed from assigned to closed.
  • resolution set to fixed.

(In [13452]) Fixed #13730 -- Removed the hard-coding of the requirement that ForeignKeys? have an index. Thanks to Suor for the report.

07/29/10 21:59:15 changed by russellm

(In [13454]) [1.2.X] Fixed #13730 -- Removed the hard-coding of the requirement that ForeignKeys? have an index. Thanks to Suor for the report.

Backport of r13452 from trunk.


Add/Change #13730 (Allow db_index=False for ForeignKey)




Change Properties
Action