News for hackers. Stuff that matters.
Re:Ways to Tweak Slow SQL Queries by julian37 on Sunday September 01, 2019 @10:58PM (#20856469)
The best strategy isn't mentioned: learning how to read EXPLAIN output and acting on it.

> Using wildcards at the start and end of a LIKE will slow queries down

That's only true if you don't have the right indexes in place. A wildcard at the end can use a regular (btree) index. Even a LIKE query with wildcards in other places can be fast with a trigram index.

https://niallburkley.com/blog/index-columns-for-like-in-post...

Re:Ways to Tweak Slow SQL Queries by janpot on Monday September 02, 2019 @02:32AM (#20857169)
> A wildcard at the end can use a regular (btree) index.

depending on the locale your db is in, it might be a little less "regular". recently fell in that trap.

http://blog.cleverelephant.ca/2016/08/pgsql-text-pattern-ops...