Code

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#18092 closed New feature (duplicate)

Composite indexes

Reported by: ivan_virabyan Owned by: nobody
Component: Database layer (models, ORM) Version: 1.4
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The patch adds support for composite indexes. Usage:

class Post(models.Model):
	creator = models.ForeignKey(User)
	date_published = models.DateTimeField()

	class Meta:
		composite_indexes = (('creator', 'date_published'),)

Attachments (1)

composite_indexes.diff (3.8 KB) - added by ivan_virabyan 2 years ago.

Download all attachments as: .zip

Change History (5)

Changed 2 years ago by ivan_virabyan

comment:1 Changed 2 years ago by ivan_virabyan

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

Just thought that index_together might be a better name, for consistency with unique_together

comment:2 Changed 2 years ago by anonymous

Something like this is certainly needed

comment:3 Changed 2 years ago by akaariai

  • Resolution set to duplicate
  • Status changed from new to closed

This seems like a duplicate of #5805. FWIW I agree that this would be a nice addition.

comment:4 Changed 2 years ago by ivan_virabyan

Thanks for pointing out! Searching didn't give me any results on this issue.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.