Performance impact.. query running too long
<p>I have written the below query but takes running too long.. how can i optimize this? can anyone have idea how to rewrite this logic with out using not exist logic?</p>

<pre><code>SELECT s.sid
FROM book s
WHERE active    =1
AND (read_only IS NULL
OR read_only    = 0)
AND cdate      IS NULL
AND NOT EXISTS
  (SELECT 1
  FROM contract con
  WHERE ((con.pid=s.sid)
  OR (con.bsid   =s.sid)
  OR (con.ssid   =s.sid)
  AND (con.cosid &lt;5))
  )
AND NOT EXISTS
  (SELECT 1 FROM pns WHERE staid=2 AND pns.abid=s.sid
  )
AND NOT EXISTS
  (SELECT 1 FROM contract_ct WHERE contract_ct.cpid=s.sid
  )
AND NOT EXISTS
  (SELECT 1 FROM cosa WHERE cosa.csid=s.sid
  );  
</code></pre>