node_counter

Slow query from statistics table

I have drupal website with ~500,000 nodes and I have problem with this query:

SELECT node.nid nid
FROM node FORCE INDEX(node_created), term_node, node_counter
WHERE node.nid = term_node.nid
AND term_node.nid = node_counter.nid
AND node.created > 1244565947
AND tid =170
AND node.nid NOT IN (218892)
AND node.status=1
AND type = 'akhbar'
ORDER BY node_counter.totalcount DESC LIMIT 0 , 4

Can anyone help ?

if I don't use "FORCE INDEX(node_created)" the query is 10 times slower.

Login to post comments
Syndicate content