Simple queries that run for hours

I should have added: there are indexes for these queries, and the slow queries show they are being used. So it’s not a simple table scan issue.