3 ms·
Sargable Queries and MUL Indexes; or Why My Query Is Slow
- Zababa 5y agoNice article, it uses Ruby but is applicable to everything that uses MySQL. Maybe MySQL should be in the title of the article?
- thomascountz 5y agoThanks for the feedback!
- Zababa 5y agoThanks for the article, I learned something new!
- mkesper 5y agoSure there are a lot (a lot = 8612441) rows, but I feel like I’ve seen text searching work before. Should we switch to Postgres? How does %TEXT% search compare in PostgreSQL?
- thomascountz 5y ago"Should we switch to Postgres" is a bit of a tongue-in-cheek comment on the desire to switch tools when things get tricky, not a real suggestion in this case. To my knowledge, Postgres' %TEXT% pattern matching would behave very similarly to MySQL's, given the lack of indexing. From the Postgres docs[0]: > Textual search operators have existed in databases for years. PostgreSQL has ~, ~*, LIKE, and ILIKE operators for textual data types, but they lack many essential properties required by modern information systems: > > ... > They tend to be slow because there is no index support, so they must process all documents for every search. [0] - https://www.postgresql.org/docs/9.5/textsearch-intro.html#TEXTSEARCH-MATCHING https://www.postgresql.org/docs/9.5/textsearch-intro.html#TE...