Skip to content

Add PostgreSQL indexes for all generic foreign key fields #14436

@jeremystretch

Description

@jeremystretch

Proposed Changes

For all GenericForeignKey (GFK) relationships in a model, a PostgreSQL index should be created for its two concrete fields (content type and ID).

Justification

Creating indexes for these fields enables optimized lookup of records by related object. (Django unfortunately does not create these indexes automatically.)

Metadata

Metadata

Assignees

Labels

status: acceptedThis issue has been accepted for implementationtype: housekeepingChanges to the application which do not directly impact the end user

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions