In analysing slow queries for T152786 I realised that the query to determine how backed up the contribution queue is could be much quicker. The query counts the number of contacts with a creation date greater than x (eg 4 minutes ago). However, it turns out created_date is not indexed & the query takes around 10 seconds. I think I could get it down to 1 by getting the created_date of max(id) - threshold and then comparing it to 4 minutes ago.
10 seconds is not horrifically slow but it stood out as it is frequent. On one occasion the query was much slower - presumably because of other stuff going on. There was one other frequent query that takes 12 seconds - on the thank you job