have following query which runs slow, It produces a list of ACTION records with "action.typeid=1" and also counts if an ACTION record with "typeid=2" exists. It is this count which is slowing things - it uses temporary and filesort!!! can you help me find out how to improve.have following query which runs slow, It produc