Opened 8 years ago

Closed 6 years ago

#26974 closed New feature (fixed)

Add support for Hash indexes

Reported by: Akshesh Doshi Owned by: Nick Pope
Component: contrib.postgres Version: dev
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 by Akshesh Doshi, 8 years ago

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

comment:2 by Nick Pope, 8 years ago

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 by Tim Graham, 8 years ago

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 by Nick Pope, 7 years ago

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 by Nick Pope, 7 years ago

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 by Tim Graham, 7 years ago

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

comment:7 by Akshesh Doshi, 7 years ago

Keywords: db-indexes added

comment:8 by Carlton Gibson, 6 years ago

Triage Stage: AcceptedReady for checkin

comment:9 by Tim Graham <timograham@…>, 6 years ago

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