1
0
Fork 0
mirror of https://github.com/archtechx/laravel-tips.git synced 2025-12-12 13:24:03 +00:00
laravel-tips/content/tips/use-postgresqls-trigram-indexes-to-make-where-like-queries-faster.md
lukinovec e907eba3dd
Weekly thread #4 (#26)
* Use Author::updateOrCreate instead of firstOrCreate

* Weekly tips #4
2022-01-28 18:03:12 +01:00

634 B
Raw Permalink Blame History

title tweet_id thread_slug author_username images created_at slug
Use PostgreSQL's trigram indexes to make WHERE LIKE queries faster 1487081932202463236 weekly-thread-2022-04 tobias_petry
https://pbs.twimg.com/media/FKB7gJiWQAwc5QS.jpg
2022-01-28T15:15:35+00:00 use-postgresqls-trigram-indexes-to-make-where-like-queries-faster

Database Tip

Every database performance guide is repeating the false statement stating WHERE LIKE '%search%' queries can't use an index. That is just not true! Most probably your database can't, but PostgreSQL implements trigram indexes which will make this really fast!