Opened 6 years ago

Closed 6 years ago

#28046 closed New feature (fixed)

Add tablespace support to Index class

Reported by: Markus Holtermann Owned by: Mariusz Felisiak
Component: Database layer (models, ORM) Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


For now, the django.db.models.indexes.Index class determines a non-default tablespace from its model field if the index is defined on a single field (Field.db_tablespace) or from a model's _meta.db_tablespace for multi-column indexes. Indexes on expressions, however, won't be able to identify which columns they refer to.

The initial API design would be to add db_tablespace or tablespace as an attribute to the Index class and use that if provided, and fallback to the current behavior if not given.

Change History (7)

comment:1 Changed 6 years ago by Tim Graham

Triage Stage: UnreviewedAccepted

comment:2 Changed 6 years ago by Mariusz Felisiak

Owner: changed from nobody to Mariusz Felisiak
Status: newassigned

comment:3 Changed 6 years ago by Markus Holtermann

Has patch: set
Needs tests: set

comment:4 Changed 6 years ago by Mariusz Felisiak

Needs tests: unset

comment:5 Changed 6 years ago by Tim Graham

Patch needs improvement: set

comment:6 Changed 6 years ago by Mariusz Felisiak

Patch needs improvement: unset

comment:7 Changed 6 years ago by GitHub <noreply@…>

Resolution: fixed
Status: assignedclosed

In 3297dede:

Fixed #28046 -- Added the db_tablespace parameter to class-based indexes.

Thanks Markus Holtermann and Tim Graham for reviews.

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