boost_cache_directory() runs the following query:

SELECT count(DISTINCT base_dir) FROM {boost_cache}

In MySQL < 5.5, SELECT COUNT(DISTINCT(xyz)) has really bad performance.

http://bugs.mysql.com/bug.php?id=21849

Run against a boost_cache table in MySQL 5.1 SP1 Enterprise with about 800,000 records, this query takes 7 seconds. The suggested alternate is this:

SELECT COUNT(*) FROM (SELECT DISTINCT base_dir FROM {boost_cache} GROUP BY base_dir) AS counted;

Note that an alias ("AS counted") is required. This query takes 1-2 seconds on the same test database. Changing this query can significantly improve performance for a large user base.