Created
October 29, 2012 04:50
-
-
Save kaja47/3971590 to your computer and use it in GitHub Desktop.
Daily dose of MySQL hackery
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- rather slow | |
| select * from posts | |
| where text rlike '[[:<:]](pic|picture|image|photo)[[:>:]].*related' | |
| -- much much faster | |
| select * from posts | |
| where text like '%related%' | |
| and text rlike '[[:<:]](pic|picture|image|photo)[[:>:]].*related' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
:]