Hi guys,

I'm having a really bad time with this, this mysql query appears hundreds of times, consuming all the cpu in my server, i'm trying to find out where it's come from or how to optimize it.

This is the mtop output:

Command: Query State: Copying to tmp table

SELECT DISTINCT node.nid AS nid, node.changed AS node_changed
  FROM node node INNER JOIN node_access na ON na.nid = node.nid
  WHERE (na.grant_view >= 1 AND ((na.gid = 0 AND na.realm = 'all') OR (na.gid = 1 AND na.realm = 'workflow_access') OR (na.gid = 0 AND na.realm = 'workflow_access_owner'))) AND (node.status <> 0)ORDER BY node_changed DESC
  LIMIT 0, 1

table       |type    |possible_keys       |key         | ken_len|ref     |  rows|
1           |SIMPLE  |node                |range       |PRIMARY,|node_sta|     4|Using where; Using temporary; Using filesort
1           |SIMPLE  |na                  |ref         | PRIMARY|PRIMARY |     4|Using where; Distinct

Any ideas ?

Thanks in advance,

Elkin.