Slow query from statistics table

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

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.

Comments

wwwoliondorcom's picture

Hi,

Can you tell me how to delete all nodes that are older than 1 year directly in my database ?

I need to delete all nodes which type is "news" an that are older than 1 year.

Thanks a lot.

If you attempt to do it, your

sivaji_ganesh_jojodae's picture

If you attempt to do it, your site might end up in a miserable state.

MySQL

Group organizers

Group notifications

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