Jul 11

mimicing substr_count in mySQL

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.


Jul 11

Easy way to optimize all tables in mySQL with PHP

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 [...]


Jul 1

Performance Tuning with mySQL Keywords

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.


Jun 27

Using latitude an longitude to perform proximity searches

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.