---
title: Efficient Filtering
description: Use indexed fields and appropriate operators
url: https://docs.intuition.systems/docs/v1/graphql-api/best-practices/filtering
markdown_url: https://docs.intuition.systems/docs/v1/graphql-api/best-practices/filtering.md
version: V1
llms_index: https://docs.intuition.systems/docs/v1/llms.txt
---

Filter early and use indexed fields for better performance.

## Best Practice

```graphql
query GetFilteredAtoms($type: atom_type!, $since: timestamptz!) {
  atoms(
    where: {
      type: { _eq: $type }
      created_at: { _gte: $since }
    }
    limit: 100
  ) {
    term_id
    label
  }
}
```

## Indexed Fields

These fields have database indexes:
- `term_id` (primary key)
- `creator_id`
- `type`
- `created_at`

## Operator Selection

- Use `_eq` for exact matches (not `_ilike`)
- Use `_ilike` only for pattern matching
- Use `_in` for multiple values
- Combine filters with `_and` for specificity
