# btree_gin — Postgres extension

> GIN indexes over plain columns, for mixed indexes.

Source: https://scribase.com/extensions/btree_gin

Category: Text search and indexing. Version: 1.3. Optional, enabled per project.

## About

btree_gin teaches GIN indexes to handle ordinary scalar types (integers, text, timestamps). That lets one GIN index cover a plain column together with an array, jsonb or full-text column, such as tenant_id plus tags.

## Enable it

```sql
create extension if not exists btree_gin with schema extensions;
```

## Example

```sql
create index events_tenant_tags on events using gin (tenant_id, tags);

select * from events where tenant_id = 7 and tags @> array['billing'];
```

Upstream: https://www.postgresql.org/docs/17/btree-gin.html