summaryrefslogtreecommitdiff
path: root/docs/ref/contrib/postgres/indexes.txt
diff options
context:
space:
mode:
authorMads Jensen <mje@inducks.org>2017-07-01 15:30:34 +0200
committerTim Graham <timograham@gmail.com>2017-09-04 21:08:02 -0400
commitf4135783add90e8e392db81b3592f4e3b9f01754 (patch)
tree840bc1d36cd716dffda286610cf0227c16747a74 /docs/ref/contrib/postgres/indexes.txt
parent66657eb01f36081f33d847390e4f7034ff3e9f52 (diff)
Fixed #28126 -- Added GistIndex to contrib.postgres.
Thanks to Marc Tamlyn for the initial patch.
Diffstat (limited to 'docs/ref/contrib/postgres/indexes.txt')
-rw-r--r--docs/ref/contrib/postgres/indexes.txt32
1 files changed, 32 insertions, 0 deletions
diff --git a/docs/ref/contrib/postgres/indexes.txt b/docs/ref/contrib/postgres/indexes.txt
index d055a381c5..6e2a01210f 100644
--- a/docs/ref/contrib/postgres/indexes.txt
+++ b/docs/ref/contrib/postgres/indexes.txt
@@ -48,3 +48,35 @@ available from the ``django.contrib.postgres.indexes`` module.
.. versionchanged:: 2.0
The ``fastupdate`` and ``gin_pending_list_limit`` parameters were added.
+
+``GistIndex``
+=============
+
+.. class:: GistIndex(buffering=None, fillfactor=None, **options)
+
+ .. versionadded:: 2.0
+
+ Creates a `GiST index
+ <https://www.postgresql.org/docs/current/static/gist.html>`_. These indexes
+ are automatically created on spatial fields with :attr:`spatial_index=True
+ <django.contrib.gis.db.models.BaseSpatialField.spatial_index>`. They're
+ also useful on other types, such as
+ :class:`~django.contrib.postgres.fields.HStoreField` or the :ref:`range
+ fields <range-fields>`.
+
+ To use this index on data types not in the built-in `gist operator classes
+ <https://www.postgresql.org/docs/current/static/gist-builtin-opclasses.html>`_,
+ you need to activate the `btree_gist extension
+ <https://www.postgresql.org/docs/current/static/btree-gist.html>`_ on
+ PostgreSQL. You can install it using the
+ :class:`~django.contrib.postgres.operations.BtreeGistExtension` migration
+ operation.
+
+ Set the ``buffering`` parameter to ``True`` or ``False`` to manually enable
+ or disable `buffering build`_ of the index.
+
+ Provide an integer value from 10 to 100 to the fillfactor_ parameter to
+ tune how packed the index pages will be. PostgreSQL's default is 90.
+
+ .. _buffering build: https://www.postgresql.org/docs/current/static/gist-implementation.html#GIST-BUFFERING-BUILD
+ .. _fillfactor: https://www.postgresql.org/docs/current/static/sql-createindex.html#SQL-CREATEINDEX-STORAGE-PARAMETERS