I am using PostgreSQL 9.4 and having tough time with slow queries. Some of these use "like" and others use "not like" searches. For like
searches I could resolve by using trigram indexes, but those with not like
are a headache.
e.g.
select * from mytable where user_code not like 'TE%'
EXPLAIN ANALYZE
says "Seq scan". How can I make Postgres use index in such cases?
explain (analyze, verbose)
. Formatted text please, no screen shots