I have dedicated server and drupal install with 170k nodes.
The following queries I get in slow_query.log:
### 13 Queries
### Total time: 15.395317, Average time: 1.18425515384615
### Taking 1.159970 to 1.207693 seconds to complete
### Rows analyzed 172884 - 172929
SELECT n.nid FROM node n LEFT JOIN xmlsitemap x ON x.type = 'node' AND n.nid = x.id
WHERE x.id IS NULL AND n.type IN ('news','reviews') ORDER BY n.nid DESC LIMIT 0, 100;
### 7 Queries
### Total time: 6.247181, Average time: 0.892454428571429
### Taking 0.859866 , 0.880130 , 0.880700 , 0.890990 , 0.907048 , 0.912626 , 0.915821 seconds to complete
### Rows analyzed 346040, 346045, 346053, 346079, 346113, 346131 and 346155
SELECT src, dst FROM url_alias WHERE language = 'ru' ORDER BY pid;
### 3 Queries
### Total time: 1.889152, Average time: 0.329717333333333
### Taking 0.620773 , 0.625654 , 0.642725 seconds to complete
### Rows analyzed 132500, 148500 and 150000
SELECT x.loc, x.lastmod, x.changefreq, x.changecount, x.priority, x.language FROM xmlsitemap x WHERE x.access = 1 AND x.status = 1 ORDER BY x.language, x.loc LIMIT 132000, 500;
For the last query I added ALTER TABLE xmlsitemap add UNIQUE INDEX access_status_language_loc (access,status,language,loc)
and hook_query_xmlsitemap_generate_alter(array &$query, array &$args, array $sitemap) {
$query['FROM'] .= " FORCE INDEX (access_status_language_loc)";
}
This query became 2-x times faster, is there any suggestions to speed up the rest?
And how can I add SQL_NO_CACHE to query "SELECT src, dst FROM url_alias WHERE language = 'ru' ORDER BY pid" - should I hack the module?
Comments
Comment #1
asb commentedAny updates on this issue?