It's pronounced Diane. I do data architecture, operations, and backend development. In my spare time I maintain Massive.js, a data mapper for Node.js and PostgreSQL.
Since you're running on Postgres, you can use ILIKE for a case-insensitive LIKE instead of multiple conditions! There are also a couple different flavors of regular expression which are even more flexible.
The leading wildcard makes your "full-text search" non-sargable and therefore likely to perform poorly on larger tables or text fields. For actual full-text search you'll want to use tsvectors and to_tsquery().
A software engineer trying to build stuff and helping people in open source. I like beers, sunny beaches and JavaScript but I also fiddle around with a lot of other languages and tools.
Thanks, knew about ILIKE but this is just an extension for PostgreSQL. Regular expressions are of course more flexible. Also thanks for mentioning the full-text search. I will extend the article to include these points.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Since you're running on Postgres, you can use
ILIKE
for a case-insensitiveLIKE
instead of multiple conditions! There are also a couple different flavors of regular expression which are even more flexible.The leading wildcard makes your "full-text search" non-sargable and therefore likely to perform poorly on larger tables or text fields. For actual full-text search you'll want to use tsvectors and to_tsquery().
Thanks, knew about
ILIKE
but this is just an extension for PostgreSQL. Regular expressions are of course more flexible. Also thanks for mentioning the full-text search. I will extend the article to include these points.