I have two queries that each return a list of node ids
SELECT node.nid
FROM dpf_node AS node
WHERE node.type = 'image' AND node.nid;
SELECT node.nid
FROM dpf_node AS node, dpf_image_galleries_images AS image
WHERE image.image_nid = node.nid
AND node.type = 'image'
AND image.gallery_nid = 138;
Both of these are working correctly
Ultimately though I want to get the list of nodes ids that are in the first list of results and not in the second, I have been using this query:
SELECT node.nid
FROM dpf_node AS node
WHERE node.type = 'image'
AND node.nid NOT IN (SELECT node.nid
FROM dpf_node AS node, dpf_image_galleries_images AS image
WHERE image.image_nid = node.nid
AND node.type = 'image'
AND image.gallery_nid = 138);
For a while this was working fine but just this evening it is beach balling sequal pro and causing apache to grind to a halt. I suspect(/hope) that clearing out the data and starting again will solve it but really want to fix the real problem in case it rears its head once the system is live.