#27135 closed Cleanup/optimization (fixed)
Standardise type value returned by introspection.get_constraints for indexes
Reported by: | Akshesh Doshi | Owned by: | nobody |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | dev |
Severity: | Normal | Keywords: | introspection db-indexes 1.11 |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Currently, Django supports introspection of index type for PostgreSQL and would be supporting it for other backends as well in future.
Currently the value returned for type
is arbitrary but it would be better to set a standard values associated with each index types (like using Index.suffix
as suggested by Tim Graham). This discussion might make it more clear - https://github.com/django/django/pull/7046#discussion-diff-74431956
Change History (5)
comment:1 by , 8 years ago
Keywords: | db-indexes 1.11 added |
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:2 by , 8 years ago
Note:
See TracTickets
for help on using tickets.
To address this for 1.11, I think all that's involved is having Django's database introspection return 'idx' (
Index.suffix
) instead of 'btree'. It looks like the other indexes (brin/gin for PostgreSQL) are already returningIndex.suffix
.Functionality wise, nothing changes since
inspectdb
doesn't consider indexes yet (#27060) but this will set expectations for third-party database backends and prevent them from having to change in a future Django release.