PostgREST 500: canceling statement due to statement timeout on a jsonb filter
SupabaseConfirmed fix
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.