---
title: "Innéacsanna samhail sonracha PostgreSQL"
version: 6.0
locale: ga
source: https://docs.djangoproject.com/ga/6.0/ref/contrib/postgres/indexes/
canonical: https://djangodocs.dev/ga/6.0/ref/contrib/postgres/indexes/
---
# Innéacsanna samhail sonracha PostgreSQL

Is iad seo a leanas sonrach PostgreSQL: doc: indexes atá ar fáil ón modúl `django.contrib.postgres.indexes` \</ref/models/indexes\>.

## Bloomindex \`\`

#### `class BloomIndex(*expressions, length=None, columns=(), **options)`

Cruthaíonn innéacs [blá](https://www.postgresql.org/docs/current/bloom.html).

Chun an rochtain innéacs seo a úsáid ní mór duit an síneadh [bloom](https://www.postgresql.org/docs/current/bloom.html) a ghníomhachtú ar PostgreSQL. Is féidir leat é a shuiteáil ag baint úsáide as oibríocht imirce:: class: ~django.contrib.postgres.operations.bloomextension.

Cuir líon sláireach giotán ó 1 go 4096 ar fáil go dtí an paraiméadar fad chun fad gach iontráil innéacs a shonrú. Is é 80 réamhshocraithe PostgreSQL.

Tógann an argóint `colúna` tuple nó liosta de suas le 32 luach atá ina líon slámhshláir giotán ó 1 go 4095.

## Brinindex \`\`

#### `class BrinIndex(*expressions, autosummarize=None, pages_per_range=None, **options)`

Creates a [BRIN index](https://www.postgresql.org/docs/current/brin.html).

Socraigh an paraiméadar `autoresumize` go True\` chun go mbeidh achoimre uathoibríoch \_ a dhéanamh le autovacuum.

Glacann an argóint `pages_per_range` sláimhir dhearfach.

## `Btreeindex`

#### `class BTreeIndex(*expressions, fillfactor=None, deduplicate_items=None, **options)`

Cruthaíonn innéacs B-Tree.

Cuir luach sláimhir ó 10 go 100 ar fáil don pharaiméadar [fillfactor](https://www.postgresql.org/docs/current/sql-createindex.html#SQL-CREATEINDEX-STORAGE-PARAMETERS) chun a thiúnadh cé chomh pacáilte a bheidh na leathanaigh innéacs. Is é 90 réamhshocraithe PostgreSQL.

Cuir luach boolean ar fáil don pharaiméadar [deduplicate\_items](https://www.postgresql.org/docs/current/btree.html#BTREE-DEDUPLICATION) chun a rialú an bhfuil deduplication cumasaithe. Cumasaíonn PostgreSQL dídhúbailt de réir réamhshocraithe.

## Ginindex \`\`

#### `class GinIndex(*expressions, fastupdate=None, gin_pending_list_limit=None, **options)`

\< <https://www.postgresql.org/docs/current/gin.html>\>Cruthaíonn innéacs gin \_.

To use this index on data types not in the [built-in operator classes](https://www.postgresql.org/docs/current/gin.html#GIN-BUILTIN-OPCLASSES),
you need to activate the [btree\_gin extension](https://www.postgresql.org/docs/current/btree-gin.html) on
PostgreSQL. You can install it using the
[`BtreeGinExtension`](/ga/6.0/ref/contrib/postgres/operations/#django.contrib.postgres.operations.BtreeGinExtension) migration
operation.

Socraigh an paraiméadar `fastupdate` go False\` chun an [GIN Fast Update Technique](https://www.postgresql.org/docs/current/gin.html#GIN-FAST-UPDATE) atá cumasaithe de réir réamhshocraithe i PostgreSQL a dhíchumasú.

Cuir líon sláimhir cileobaití ar fáil don pharaiméadar [gin\_pending\_list\_limit](https://www.postgresql.org/docs/current/runtime-config-client.html#GUC-GIN-PENDING-LIST-LIMIT) chun uasmhéid an liosta GIN ar feitheamh a úsáidtear nuair a chumasaítear `fastupdate`.

## `Innéacs Gist`

#### `class GistIndex(*expressions, buffering=None, fillfactor=None, **options)`

\< <https://www.postgresql.org/docs/current/gist.html>\>Cruthaíonn innéacs Gist \`\_. \<django.contrib.gis.db.models.BaseSpatialField.spatial\_index\>Cruthaítear na hinnéacsanna seo go huathoibríoch ar réimsí spásúla le:attr: \`spatial\_index = true \`. \<range-fields\>Tá siad úsáideach freisin ar chineálacha eile, mar shampla:class: \`~django.contrib.postgres.fields.hstorefield nó na:ref: réimsí raon .

To use this index on data types not in the built-in [gist operator classes](https://www.postgresql.org/docs/current/gist.html#GIST-BUILTIN-OPCLASSES),
you need to activate the [btree\_gist extension](https://www.postgresql.org/docs/current/btree-gist.html) on PostgreSQL.
You can install it using the
[`BtreeGistExtension`](/ga/6.0/ref/contrib/postgres/operations/#django.contrib.postgres.operations.BtreeGistExtension) migration
operation.

Socraigh an paraiméadar `maolánach` go True\` nó `False` chun [tógáil maolánai](https://www.postgresql.org/docs/current/gist.html#GIST-BUFFERING-BUILD) an innéacs a chumasú nó a dhíchumasú de láimh.

Cuir luach sláimhir ó 10 go 100 ar fáil don pharaiméadar [fillfactor](https://www.postgresql.org/docs/current/sql-createindex.html#SQL-CREATEINDEX-STORAGE-PARAMETERS) chun a thiúnadh cé chomh pacáilte a bheidh na leathanaigh innéacs. Is é 90 réamhshocraithe PostgreSQL.

## `HashIndex`

#### `class HashIndex(*expressions, fillfactor=None, **options)`

Cruthaíonn innéacs hash.

Cuir luach sláimhir ó 10 go 100 ar fáil don pharaiméadar [fillfactor](https://www.postgresql.org/docs/current/sql-createindex.html#SQL-CREATEINDEX-STORAGE-PARAMETERS) chun a thiúnadh cé chomh pacáilte a bheidh na leathanaigh innéacs. Is é 90 réamhshocraithe PostgreSQL.

## `Innéacs SPGIST`

#### `class SpGistIndex(*expressions, fillfactor=None, **options)`

\< <https://www.postgresql.org/docs/current/spgist.html>\>Cruthaíonn innéacs SP-Gist \_.

Cuir luach sláimhir ó 10 go 100 ar fáil don pharaiméadar [fillfactor](https://www.postgresql.org/docs/current/sql-createindex.html#SQL-CREATEINDEX-STORAGE-PARAMETERS) chun a thiúnadh cé chomh pacáilte a bheidh na leathanaigh innéacs. Is é 90 réamhshocraithe PostgreSQL.

## Nathanna opClass () \`\`

#### `class OpClass(expression, name)`

Léiríonn abairt ```opClass () ``an `léiriú ``léirithe``` le rang oibreora \`\_ saincheaptha is féidir a úsáid chun innéacsanna feidhmiúla, srianta uathúla feidhmiúla, nó srianta eisiaimh a shainiú. Chun é a úsáid, ní mór duit \`'django.contrib.postgres'\`\` a chur i d':setting: INSTALLED\_APPS. Socraigh an paraiméadar ainm ar ainm an ranga oibreora \_.

Mar shampla:

```
Index(
    OpClass(Lower("username"), name="varchar_pattern_ops"),
    name="lower_username_idx",
)
```

cruthaíonn innéacs ar ```Lower ('username') ``ag baint úsáide as ``varchar_pattern_ops``` .

```
UniqueConstraint(
    OpClass(Upper("description"), name="text_pattern_ops"),
    name="upper_description_unique",
)
```

cruthaíonn srian uathúil ar ```Uachtarach ('cur síos') ``ag baint úsáide as ``text_pattern_ops``` .

```
ExclusionConstraint(
    name="exclude_overlapping_ops",
    expressions=[
        (OpClass("circle", name="circle_ops"), RangeOperators.OVERLAPS),
    ],
)
```

cruthaíonn srian eisiaimh ar `circle` ag baint úsáide as `circle_ops`.
