I have a MySql table containing over 500,000 records. This table contains some keywords to detect and block, like adult keywords. So what I have to do is that I will lookup a word in this table, there will be a %like% match. If a positive like match is found that keyword will be selected.
Now such a match on entire table will be inherently slower. So can I partition this table by range? Like a-d then e-h and so on? If so is there any specific engine that I can use for it?
Now there’s one more scenario. This table going to be updated once a week or more frequent than that. Currently it is default MyISAM table. I had read that MyISAM implements table level locking. So whenever there will be updates on this table, will they not benefit from any partitioning scheme?
So can anyone explain me which partitioning scheme can I use for this scenario or can I benefit from any partitioning scheme at all?
If you really need the %like%, a completely different approach will be necessary. Have a look at Tries and Suffix Trees:
https://en.wikipedia.org/wiki/Trie
https://en.wikipedia.org/wiki/Suffix_tree