Comment 12 for bug 607935

Robert Collins (lifeless) wrote :

so the 5 second query is 20s cold on qastaging, 300ms hot; this may be a cold cache effect.

However, what we want is the first and last 40 comments;

this seems reasonable and is 30ms rather than 300ms hot:

SELECT MessageChunk.blob, MessageChunk.content,
                          Message.OWNER, Message.parent,
FROM BugMessage,
WHERE = MessageChunk.message
  AND BugMessage.message =
  AND BugMessage.bug = 1
  and (bugmessage.index < 41 or bugmessage.index > (select max(index) -40 from bugmessage where bug=1))
 ORDER BY BugMessage.index, Message.datecreated,,