I’ve been developing an n-gram based search in PHP for a secondary project at work. For development purposes, I’ve been scoring things in PHP while I tweaked by algorithm, but now that I’m getting closer to the implementation stage of things I’m trying to push the work of scoring onto mySQL.
I ran across a pretty old “hack” that grabs a list of all the tables and forces
them to optimize. Its generally a pretty useful script to schedule and run once
a week. For those of you playing the home game, you’ll need to tap into your own
database class or adjust it to use the [...]
Ever have performance issues with your queries even after you’ve optimized them? You
can do a few mySQL specific tricks using keywords in order to force certain behaviors.
Here’s a query I use to find find the closest X locations to a particular latitude and longitude. I usually end up combining it with a lot of other query business, but in this case I’ve tried to remove everything that isn’t related to the proximity
query.