3 ms·
The main issue is that since you are using %searchterm% you aren't getting any real use out of indexes as you would when using something like searchterm%. You
by elliottcarlson 16y ago
The main issue is that since you are using %searchterm% you aren't getting any real use out of indexes as you would when using something like searchterm%.
You could have a second table that has permutations of the data allowing indexing of the content, but your records would increase dramatically in that second table;
i.e.
| id | link_id | url_permuted |
+----+---------+--------------+
| 1 | 1 | oogle.com |
| 2 | 1 | ogle.com |
| 3 | 1 | gle.com |
| 4 | 1 | le.com |
This would allow you to search by searchterm% while gaining use of indexing...
Not sure if this is the most elegant solution to your current problem though - and it could result in multiple hits to the same record...
- rorrr 16y agoThanks for the idea. Many of the URLs are long. The average length is 43.9 characters. That would make the auxiliary table huge.