{"title":"PostgreSQL specific model indexes","version":"1.11","locale":"el","docname":"ref/contrib/postgres/indexes","url":"/el/1.11/ref/contrib/postgres/indexes/","canonical":"https://djangodocs.dev/el/1.11/ref/contrib/postgres/indexes/","summary":"New in Django 1.11 The following are PostgreSQL specific indexes available from the django.contrib.postgres.indexes module. BrinIndex Link to this heading # class…","html":"<span id=\"postgresql-specific-model-indexes\"></span><h1>PostgreSQL specific model indexes<a class=\"heading-anchor\" href=\"#module-django.contrib.postgres.indexes\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h1>\n<aside class=\"version-note version-added\" data-version=\"1.11\">\n<p class=\"version-note-title\">New in Django 1.11</p></aside>\n<p>The following are PostgreSQL specific <a class=\"reference internal\" href=\"/el/1.11/ref/models/indexes/\"><span class=\"doc\">indexes</span></a>\navailable from the <code class=\"docutils literal notranslate\"><span class=\"pre\">django.contrib.postgres.indexes</span></code> module.</p>\n<section id=\"brinindex\">\n<h2><code class=\"docutils literal notranslate\"><span class=\"pre\">BrinIndex</span></code><a class=\"heading-anchor\" href=\"#brinindex\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<dl class=\"py class\">\n<dt class=\"sig sig-object py\" id=\"django.contrib.postgres.indexes.BrinIndex\">\n<em class=\"property\"><span class=\"k\"><span class=\"pre\">class</span></span><span class=\"w\"> </span></em><span class=\"sig-name descname\"><span class=\"pre\">BrinIndex</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">fields</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">[]</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">name</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">None</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">pages_per_range</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">None</span></span></em><span class=\"sig-paren\">)</span><a class=\"heading-anchor\" href=\"#django.contrib.postgres.indexes.BrinIndex\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd><p>Creates a <a class=\"reference external\" href=\"https://www.postgresql.org/docs/current/static/brin-intro.html\">BRIN index</a>.</p>\n<p>The <code class=\"docutils literal notranslate\"><span class=\"pre\">pages_per_range</span></code> argument takes a positive integer.</p>\n</dd></dl>\n\n</section>\n<section id=\"ginindex\">\n<h2><code class=\"docutils literal notranslate\"><span class=\"pre\">GinIndex</span></code><a class=\"heading-anchor\" href=\"#ginindex\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<dl class=\"py class\">\n<dt class=\"sig sig-object py\" id=\"django.contrib.postgres.indexes.GinIndex\">\n<em class=\"property\"><span class=\"k\"><span class=\"pre\">class</span></span><span class=\"w\"> </span></em><span class=\"sig-name descname\"><span class=\"pre\">GinIndex</span></span><a class=\"heading-anchor\" href=\"#django.contrib.postgres.indexes.GinIndex\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd><p>Creates a <a class=\"reference external\" href=\"https://www.postgresql.org/docs/current/static/gin.html\">gin index</a>.</p>\n<p>To use this index on data types not in the <a class=\"reference external\" href=\"https://www.postgresql.org/docs/current/static/gin-builtin-opclasses.html\">built-in operator classes</a>,\nyou need to activate the <a class=\"reference external\" href=\"https://www.postgresql.org/docs/current/static/btree-gin.html\">btree_gin extension</a> on\nPostgreSQL. You can install it using the\n<a class=\"reference internal\" href=\"/el/1.11/ref/contrib/postgres/operations/#django.contrib.postgres.operations.BtreeGinExtension\" title=\"django.contrib.postgres.operations.BtreeGinExtension\"><code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">BtreeGinExtension</span></code></a> migration\noperation.</p>\n</dd></dl>\n\n</section>","rootId":"module-django.contrib.postgres.indexes","toc":[{"title":"BrinIndex","anchor":"brinindex","children":[]},{"title":"GinIndex","anchor":"ginindex","children":[]}],"breadcrumbs":[{"docname":"ref/index","title":"API Reference","url":"/el/1.11/ref/"},{"docname":"ref/contrib/index","title":"contrib packages","url":"/el/1.11/ref/contrib/"},{"docname":"ref/contrib/postgres/index","title":"django.contrib.postgres","url":"/el/1.11/ref/contrib/postgres/"}],"prev":{"docname":"ref/contrib/postgres/functions","title":"PostgreSQL specific database functions","url":"/el/1.11/ref/contrib/postgres/functions/"},"next":{"docname":"ref/contrib/postgres/lookups","title":"PostgreSQL specific lookups","url":"/el/1.11/ref/contrib/postgres/lookups/"},"formats":{"html":"/el/1.11/ref/contrib/postgres/indexes/","markdown":"/el/1.11/ref/contrib/postgres/indexes.md","json":"/el/1.11/ref/contrib/postgres/indexes.json"},"source":"https://github.com/django/django/blob/stable/1.11.x/docs/ref/contrib/postgres/indexes.txt","official":"https://docs.djangoproject.com/el/1.11/ref/contrib/postgres/indexes/","inVersions":["6.1","6.0","5.2","5.1","5.0","4.2","4.1","4.0","3.2","3.1","3.0","2.2","2.1","2.0","1.11"],"inLocales":["en","fr","ja","id","pt-br","ko","es","el","pl"]}