Opened 2 years ago

Closed 3 months ago

#26974 closed New feature (fixed)

Add support for Hash indexes

Reported by: Akshesh Doshi Owned by: Nick Pope
Component: contrib.postgres Version: master
Severity: Normal Keywords: hash, index, postgres, db-indexes
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

Adding support for using hash indexes.

These indexes are only supported by postgresql and by only by a very few engines (neither InnoDB nor MyISAM though) on mysql.

Also, since practically this index is supported only by postgres, would it be a good idea to add it to contrib.postgres ?

Change History (9)

comment:1 Changed 2 years ago by Akshesh Doshi

Has patch: set
Owner: changed from nobody to Akshesh Doshi
Status: newassigned

comment:2 Changed 2 years ago by Nick Pope

I'm not sure that hash indexes are a good idea right now as they are currently not replication- or crash-safe.

See the documentation: https://www.postgresql.org/docs/9.5/static/indexes-types.html

It looks like some work is being done to resolve this: https://commitfest.postgresql.org/10/647/

comment:3 Changed 2 years ago by Tim Graham

Triage Stage: UnreviewedSomeday/Maybe

Given the last comment, it seems prudent to have a discussion on the DevelopersMailingList about whether or not to implement this.

comment:4 Changed 11 months ago by Nick Pope

I think this could be revisited now that PostgreSQL 10 is released and hash indexes have been fixed:

We should limit use of this index type to PostgreSQL 10 or later if that is possible.

comment:5 Changed 11 months ago by Nick Pope

Keywords: hash index postgres added; db-indexes removed
Owner: changed from Akshesh Doshi to Nick Pope
Triage Stage: Someday/MaybeUnreviewed

As per my previous comment, hash indexes have been fixed in PostgreSQL 10.

New pull request incoming...

comment:6 Changed 11 months ago by Tim Graham

Component: Database layer (models, ORM)contrib.postgres
Summary: Support for Hash indexesAdd support for Hash indexes
Triage Stage: UnreviewedAccepted

comment:7 Changed 11 months ago by Akshesh Doshi

Keywords: db-indexes added

comment:8 Changed 3 months ago by Carlton Gibson

Triage Stage: AcceptedReady for checkin

comment:9 Changed 3 months ago by Tim Graham <timograham@…>

Resolution: fixed
Status: assignedclosed

In d526b077:

Fixed #26974 -- Added HashIndex to django.contrib.postgres.

Thanks Akshesh Doshi for the initial implementation.

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