CREATE INDEX codes_collection_id_idx ON public.codes (collection_id); CREATE INDEX codes_is_used_idx ON public.codes (is_used);