node_counter

Events happening in the community are now at Drupal community events on www.drupal.org.
ghayoumi's picture

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.

Read more
Subscribe with RSS Syndicate content

MySQL

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: