Fixed #30943 -- Added BloomIndex to django.contrib.postgres.

This commit is contained in:
Nick Pope 2019-10-18 10:08:50 +01:00 committed by Mariusz Felisiak
parent 26554cf5d1
commit 02983c5242
8 changed files with 177 additions and 5 deletions

View file

@ -7,6 +7,29 @@ PostgreSQL specific model indexes
The following are PostgreSQL specific :doc:`indexes </ref/models/indexes>`
available from the ``django.contrib.postgres.indexes`` module.
``BloomIndex``
==============
.. class:: BloomIndex(length=None, columns=(), **options)
.. versionadded:: 3.1
Creates a bloom_ index.
To use this index access you need to activate the bloom_ extension on
PostgreSQL. You can install it using the
:class:`~django.contrib.postgres.operations.BloomExtension` migration
operation.
Provide an integer number of bits from 1 to 4096 to the ``length``
parameter to specify the length of each index entry. PostgreSQL's default
is 80.
The ``columns`` argument takes a tuple or list of up to 32 values that are
integer number of bits from 1 to 4095.
.. _bloom: https://www.postgresql.org/docs/current/bloom.html
``BrinIndex``
=============

View file

@ -49,6 +49,15 @@ run the query ``CREATE EXTENSION IF NOT EXISTS hstore;``.
This is a required argument. The name of the extension to be installed.
``BloomExtension``
==================
.. class:: BloomExtension()
.. versionadded:: 3.1
Install the ``bloom`` extension.
``BtreeGinExtension``
=====================