I have been seeing quite a large variation in response times regarding LIKE
queries to a particular table in my database. Sometimes I will get results within 20
for what it's worth, Django ORM tends to use UPPER(text)
for all LIKE
queries to make it case insensitive,
Adding an index on UPPER(column::text)
has greatly sped up my system, unlike any other thing.
As far as leading %, yes that will not use an index. See this blog for a great explanation:
https://use-the-index-luke.com/sql/where-clause/searching-for-ranges/like-performance-tuning