Postgresql – How to combine LEFT and LOWER in a multicolumn index for leading text patterns?
I create an index this way: CREATE INDEX rep_tval_idx ON public.rep USING btree (t, lower(left(val, 127))); Then I run a SELECT with matching filter: explain select * from rep where t=3 and lower(left(val, 127)) like 'operation%'; According to EXPLAIN the…