Dan, when I was working on the last 5 threads, I removed the select count ... from the query. Didn't think that it was doing anything. I also had to pull more than the last 5 posts to get the last 5 threads. Dean Daniel J. Cody writes: > <cfquery name="lastfive" datasource="#data#" maxrows="5" > blockfactor="75"> > select id, subject, author from posts > where id >= (select count(*) -5 from posts) > order by id desc > </cfquery> > > this appeared to me to be the same sort of query(get id where its > X) > as above, but it runs at right around 5 secs. i then threw a > cachedwithin attribute in there and its actually pretty quick now. > > so it used to take about 15 secs for that 'last 5 msgs on thelist' thing > to run, now its at about 5. i'm still going to have adam look over it > and see if theres any other way i can optimize it, but i'm not unhappy > with what we have now.