From f4135783add90e8e392db81b3592f4e3b9f01754 Mon Sep 17 00:00:00 2001 From: Mads Jensen Date: Sat, 1 Jul 2017 15:30:34 +0200 Subject: Fixed #28126 -- Added GistIndex to contrib.postgres. Thanks to Marc Tamlyn for the initial patch. --- docs/ref/contrib/postgres/indexes.txt | 32 ++++++++++++++++++++++++++++++++ docs/ref/contrib/postgres/operations.txt | 9 +++++++++ docs/releases/2.0.txt | 6 ++++++ 3 files changed, 47 insertions(+) (limited to 'docs') 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 + `_. These indexes + are automatically created on spatial fields with :attr:`spatial_index=True + `. They're + also useful on other types, such as + :class:`~django.contrib.postgres.fields.HStoreField` or the :ref:`range + fields `. + + To use this index on data types not in the built-in `gist operator classes + `_, + you need to activate the `btree_gist extension + `_ 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` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- cgit v1.3