node_load() Performance and alternatives I created a custom module which lists the last X nodes from a certain content type, with the following query:

SELECT n.title, r.teaser, r.timestamp
FROM node n
INNER JOIN node_revisions r ON r.vid = n.vid
INNER JOIN term_node tn ON tn.nid = n.nid
INNER JOIN term_data t ON t.tid = tn.tid
WHERE t.name= 'breaking_news'
AND n.status = 1
ORDER BY n.nid DESC LIMIT 25


Then I do a node_load($nid) to check if there is a image and an audio file inside, for example

$mynode = node_load($queryresutl-&gt;nid);
if ($mynode-&gt;field_efe_audio[0]['filepath']) {  
  $audio = 'yep, has audio'; 
}


But I've read that node_load() could be a performance killer, so I wonder if this is true and if there's is an alternative to check fields in my module?
First i would make sure that using node_load() does slower your script. If you are sure it really does you can either:


1- Create an index_audio  table with a nid and use_audio columns.
You could update this table on node creation/update/delete. Then
you can just query this table to make sure a specific node does have
audio attached to it. I would use that solution only if i you have to
intensively make such a check
2- Directly query your field table with your nid as etid, in your
instance : field_data_field_efe_audio table see if it returns
FALSE or some actual data