VibeGuard
Detection rules
mediumperformanceconnected project

RLS predicate column is not indexed

UNINDEXED_RLS_PREDICATE

RLS predicates run on every candidate row. When the predicate column has no index, each query degrades into a sequential scan — the single most common cause of Supabase bills growing faster than traffic.

What the finding looks like

mediumRLS predicate column public.invoices.user_id is not indexed

How to fix it

This is real generator output, not a template — a scan substitutes your schema, table and inferred ownership column.

-- Generated by VibeGuard. Review before running in production.
-- CONCURRENTLY avoids taking a write lock; it cannot run inside a
-- transaction block, so run this statement on its own.
CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_invoices_user_id
  ON public.invoices (user_id);

Related guides

What people search for

unindexed rls policy supabasesupabase rls performance slowsupabase missing index foreign key rls

Check your own project

This rule needs a connected project. Start with the free probe to see what is exposed publicly.

Run the free audit