summaryrefslogtreecommitdiff
path: root/docs
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
parent66657eb01f36081f33d847390e4f7034ff3e9f52 (diff)
Fixed #28126 -- Added GistIndex to contrib.postgres.
Thanks to Marc Tamlyn for the initial patch.
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/contrib/postgres/indexes.txt32
-rw-r--r--docs/ref/contrib/postgres/operations.txt9
-rw-r--r--docs/releases/2.0.txt6
3 files changed, 47 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
diff --git a/docs/ref/contrib/postgres/operations.txt b/docs/ref/contrib/postgres/operations.txt
index d984d9a3f7..c04704eeb5 100644
--- a/docs/ref/contrib/postgres/operations.txt
+++ b/docs/ref/contrib/postgres/operations.txt
@@ -58,6 +58,15 @@ run the query ``CREATE EXTENSION IF NOT EXISTS hstore;``.
Install the ``btree_gin`` extension.
+``BtreeGistExtension``
+======================
+
+.. class:: BtreeGistExtension()
+
+ .. versionadded:: 2.0
+
+ Install the ``btree_gist`` extension.
+
``CITextExtension``
===================
diff --git a/docs/releases/2.0.txt b/docs/releases/2.0.txt
index 423f390433..4f92927c1e 100644
--- a/docs/releases/2.0.txt
+++ b/docs/releases/2.0.txt
@@ -117,6 +117,12 @@ Minor features
* :class:`django.contrib.postgres.indexes.GinIndex` now supports the
``fastupdate`` and ``gin_pending_list_limit`` parameters.
+* The new :class:`~django.contrib.postgres.indexes.GistIndex` class allows
+ creating ``GiST`` indexes in the database. The new
+ :class:`~django.contrib.postgres.operations.BtreeGistExtension` migration
+ operation installs the ``btree_gist`` extension to add support for operator
+ classes that aren't built-in.
+
:mod:`django.contrib.redirects`
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~