Originally this function uses following SQL language:
db_query("DELETE FROM {boost_crawler} WHERE hash IN (SELECT ca.hash_url FROM {boost_cache} ca WHERE ca.expire BETWEEN 1 AND 434966399 OR ca.expire > 434966400)");
But due MySQL bugs: http://bugs.mysql.com/bug.php?id=9021 , http://bugs.mysql.com/bug.php?id=18826 , http://bugs.mysql.com/bug.php?id=9090 index "hash" is never used. Proposed solution is to rewrite queries to use EXISTS statement and add new index to boost_cache table. Patch takes care of both.
BTW, what the purpose of " ca.expire BETWEEN 1 AND 434966399 OR ca.expire > 434966400 "???
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | 1897268-optimize-boost_crawler_prune_table-function.patch | 1.69 KB | pavel.karoukin |
Comments
Comment #1
pavel.karoukin commentedPatch attached
Comment #2
mangandini commented