I hope it is okay if I share this from your email @LinuxJedi? :
It should be noted though that it will not use any indexes so will run the regex on every row. So, without other filters there will likely be negligible performance difference between doing this on the database side and the client side (mostly the extra data transfer time and MariaDB's C++ doing the regex vs PHP execution time).
If you wanted to do it in a way that performs better, an index of keywords would be required. MariaDB has full text indexing in InnoDB for this. I don't know what MySQL does. But something custom could be written I suspect. Then you would just need to filter the results on the PHP side when you retrieve them so that the results that match inside the meta tags are filtered out
For this plugin, I'm just trying to fix the search problem and don't want to optimize the search in general. So I think for creating an own index would be overkill (Relevanssi and other plugins do this already) and if the performance difference is negligible I think I'm fine with my approach at this time.
Anything I can/should do on the plugin side to speed things up?
I hope it is okay if I share this from your email @LinuxJedi? :
For this plugin, I'm just trying to fix the search problem and don't want to optimize the search in general. So I think for creating an own index would be overkill (Relevanssi and other plugins do this already) and if the performance difference is negligible I think I'm fine with my approach at this time.
Anything I can/should do on the plugin side to speed things up?