replace select * for select 1 in the exists query.
or exists(select 1 from portal_notes as notes2 where portal_notes.topic_id = notes2.id and notes2.user_id = '43')
Also make sure you have created indexes on columns subdomain_id, user_id, patient_id, topic_id and id.