Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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...



> 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...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: