indexes.txt 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. =================================
  2. PostgreSQL specific model indexes
  3. =================================
  4. .. module:: django.contrib.postgres.indexes
  5. .. versionadded:: 1.11
  6. The following are PostgreSQL specific :doc:`indexes </ref/models/indexes>`
  7. available from the ``django.contrib.postgres.indexes`` module.
  8. ``BrinIndex``
  9. =============
  10. .. class:: BrinIndex(pages_per_range=None, **options)
  11. Creates a `BRIN index
  12. <https://www.postgresql.org/docs/current/static/brin-intro.html>`_.
  13. The ``pages_per_range`` argument takes a positive integer.
  14. ``GinIndex``
  15. ============
  16. .. class:: GinIndex(fastupdate=None, gin_pending_list_limit=None, **options)
  17. Creates a `gin index
  18. <https://www.postgresql.org/docs/current/static/gin.html>`_.
  19. To use this index on data types not in the `built-in operator classes
  20. <https://www.postgresql.org/docs/current/static/gin-builtin-opclasses.html>`_,
  21. you need to activate the `btree_gin extension
  22. <https://www.postgresql.org/docs/current/static/btree-gin.html>`_ on
  23. PostgreSQL. You can install it using the
  24. :class:`~django.contrib.postgres.operations.BtreeGinExtension` migration
  25. operation.
  26. Set the ``fastupdate`` parameter to ``False`` to disable the `GIN Fast
  27. Update Technique`_ that's enabled by default in PostgreSQL.
  28. Provide an integer number of bytes to the gin_pending_list_limit_ parameter
  29. to tune the maximum size of the GIN pending list which is used when
  30. ``fastupdate`` is enabled. This parameter requires PostgreSQL ≥ 9.5.
  31. .. _GIN Fast Update Technique: https://www.postgresql.org/docs/current/static/gin-implementation.html#GIN-FAST-UPDATE
  32. .. _gin_pending_list_limit: https://www.postgresql.org/docs/current/static/runtime-config-client.html#GUC-GIN-PENDING-LIST-LIMIT
  33. .. versionchanged:: 2.0
  34. The ``fastupdate`` and ``gin_pending_list_limit`` parameters were added.