Skip to main content
You're reading the V1 docs. They cover the first generation of Intuition: the intuition-ts packages and the intuition-rs services. New development happens in V2. Open the V2 docs
Version: V1

Efficient Filtering

Filter early and use indexed fields for better performance.

Best Practice​

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