# PostgREST 500: canceling statement due to statement timeout on a jsonb filter

> A deep jsonb path filter (.is('meta->a->b', null)) is evaluated for every row with no index, so it hits statement_timeout once the table grows.

Web page: https://davidewins.com/errors/postgrest-jsonb-filter-statement-timeout

Supabase. Confirmed fix, June 2026.

Versions: Supabase PostgREST, tables >10k rows

Error:

```
code: 57014, message: 'canceling statement due to statement timeout'
```

## Cause

A deep jsonb path filter (`.is('meta->a->b', null)`) is evaluated for every row with no index, so it hits statement_timeout once the table grows. Cron handlers that swallow the error just process zero rows.

## Fix

Filter on an indexed base column first, over-fetch, and do the jsonb check in JS. Long term, add an expression or GIN index on the path.

## More Supabase errors

- [Supabase .single() fails with PGRST116 for a row you know exists](https://davidewins.com/errors/postgrest-pgrst116-rls-hides-row)
- [Reversal runs twice when two requests race](https://davidewins.com/errors/idempotency-read-then-write-race)

[Search all errors](https://davidewins.com/errors)
