Category Archives: Development

First Stab at WordPress/MySQL Tuning

My job sent me to a class on scaling, optimizing and troubleshooting MySQL this week. I’ve been digging around a bit on some test databases at work, but of course as someone running a self-hosted WordPress blog, I had another MySQL server to practice on right here — one with real-world data and (admittedly low) load, but where I was only accountable to myself if I messed anything up.

Unfortunately, DreamHost’s MySQL VPS doesn’t give you much control over the server, and of course when you’re working with a third-party application, there’s only so much you can change the database without breaking compatibility. But I found some interesting surprises:

1: Everything was using the older MyISAM engine, because DreamHost is running an older version of MySQL that uses it as the default. Switching to the newer InnoDB (and back) is simple and safe enough that I figured it was worth a try.

2: There was a lot of junk left over from old plugins that I haven’t used in years. Continue reading

Dates and ColdFusion Query of Queries


If you need to run any date comparisons on a ColdFusion Query of Queries, you need the following:

  • In the original database query, select the values as datetime. DO NOT cast them as date. (This is with MSSQL, anyway).
  • In the follow-up query, use CFQUERYPARAM and the cf_sql_date type.

I spent waaay too long trying to select subsets of the original query based on dates, and whether I selected them as strings (for implicit conversion) or using query parameters, I just couldn’t get any results out of them. It turned out that since the original query had cast the datetime value as a date, I couldn’t make any comparisons in the query of queries.

Once I removed that cast (originally there to simply group timestamps by day, but I’d since changed the query to group by month), it worked.

<cfquery name="realquery">
select mydate, mystuff from mytable

<cfquery dbtype="query" name="followup">
select mystuff from mytable
where mydate = <cfsqlparam value="#somedate#"
                   cfsqltype="cf_sql_date" />

Obviously this example is oversimplified, but you get the idea.

Don’t Hide Version Numbers

One of the problems with Mozilla’s plan to hide Firefox version numbers is that the replacement of “You’re running the latest version” only succeeds if people have confidence that the check is working. Speaking for myself, the last time I checked About:Firefox, I was convinced that it was broken until I verified that the update I was expecting was Mac-only, which was why it wasn’t showing up on Windows.

The biggest, of course, is breaking deeply ingrained user expectations (where to find the version number) for no real discernible benefit.

Protecting Firefox from Farmville

Firefox has been testing a new release that detects and closes crashed plugins (instead of letting them crash Firefox entirely) for several months, carefully making sure everything was working before they released Firefox 3.6.4 last week.

Within days, they released an update. I couldn’t imagine what they might have missed in all the beta testing. Katie wondered if the beta testers hadn’t been testing the limits.

You want to know what convinced Mozilla to issue an update so quickly?


Apparently Firefox was detecting Farmville as frozen and closing it. It turns out that on many computers, Farmville regularly freezes up the browser for longer than 10 seconds, and its players just deal with it and wait for it to come back. Mozilla decided that the simplest thing to do would be to increase the time limit.

What this tells me is that the type of person willing to beta-test a web browser these days is not likely to be playing Farmville — or if they are, it’s likely to be on a bleeding-edge computer that can handle it without 10-second freezes.

In more practical terms: Mozilla needs to convince a wider variety of users to help test their software!

Firefox+Firebug: Slowdown Explained?

Aha! Firebug slows down JavaScript even if it’s not active on the current page. That explains a LOT! # Facebook & Gmail run so slowly in Firefox on my home computer that I’ve been running them exclusively in Opera (and now Chrome). This is almost certainly the cause.

Update: Apparently that’s not it, since I had both the console and script panels disabled as described in that article. Oh, well.