Opened 15 years ago

Closed 14 years ago

Last modified 14 years ago

#13730 closed (fixed)

Allow db_index=False for ForeignKey

Reported by: Alexander Schepanovski Owned by: Alexander Schepanovski
Component: Database layer (models, ORM) Version: 1.2
Severity: Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

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 (2)

needs_context.diff (2.1 KB ) - added by Alexander Schepanovski 15 years ago.
soft_db_index.diff (887 bytes ) - added by Alexander Schepanovski 15 years ago.

Download all attachments as: .zip

Change History (8)

by Alexander Schepanovski, 15 years ago

Attachment: needs_context.diff added

by Alexander Schepanovski, 15 years ago

Attachment: soft_db_index.diff added

comment:1 by Alexander Schepanovski, 15 years ago

Has patch: set

Sorry, first patch is for other issue.

comment:2 by Alexander Schepanovski, 15 years ago

Owner: changed from nobody to Alexander Schepanovski

comment:3 by Russell Keith-Magee, 15 years ago

Triage Stage: UnreviewedAccepted

comment:4 by Alexander Schepanovski, 15 years ago

Status: newassigned
Triage Stage: AcceptedReady for checkin

Promoting to ready for chekin since it's obvious bug

comment:5 by Russell Keith-Magee, 14 years ago

Resolution: fixed
Status: assignedclosed

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

comment:6 by Russell Keith-Magee, 14 years ago

(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.

Note: See TracTickets for help on using tickets.
Back to Top