node

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

Please help with tables

I have the following issue;
table node contain rough 200k entries;

I would like to use view which select "node.created, node.title" where node is published, belongs to term (not multiple), and content-type = news. Order by created desc.

Here is query: 255.44ms

SELECT node.nid AS nid, node.title AS node_title, node.created AS node_created FROM node node INNER JOIN term_node term_node ON node.vid = term_node.vid WHERE (node.type in ('news')) AND (node.status <> 0) AND (term_node.tid = 6) ORDER BY node_created DESC LIMIT 0, 10
Read more
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: