[08:56] lifeless: 'An iterable of slices' seems rather overkill, and possibly self defeating. What is the advantage of this over just (min_index, max_index) ? [09:01] stub: do you mean just special case the exact situation? [09:02] Do we ever see more than one slice passed in? [09:02] yes [09:02] If so, are the holes almost always a single comment? [09:02] the slices are [09:02] [:40], [-40:] [09:02] more or less [09:03] ok. That makes sense then. [09:04] If the holes were small, we could be better off pulling them and skipping unwanted ones client side than the more complex WHERE clause. [09:04] yeah [09:04] the prototypical case is bug 1 [09:04] <_mup_> Bug #1: Microsoft has a majority market share where the hole is 1200 rows long [09:05] stub: https://bugs.launchpad.net/launchpad/+bug/607935/comments/12 [09:05] <_mup_> Bug #607935: timeout on bugtask:+index < https://launchpad.net/bugs/607935 > [09:06] stub: doing two queries is 40ms total; one with the complex clause 30ms total [09:07] set(row[1].ownerID for row in rows if row[1].ownerID) [09:08] rather than the discard? its slower [09:09] doing a discard is one check for None, discarding in the loop is a check per row [09:10] Any reason you want to keep eager_load_watches() in there? [09:10] oh [09:11] thinko, will delete. [09:16] lifeless: Hmm... if you do that, doesn't that mean build_comments_from_chunks() will be loading bugwatches one at a time from the DB? [09:16] no [09:16] well [09:16] we use that in one place only [09:16] and that place is a bug context [09:16] bugs have already preloaded all bug watches. [09:17] eager_load_watches is already commented out to be uncalled [09:21] Right. I've asked for a comment anyway - when I see code like that I assume database impedance mismatch issues and one-query-per-iteration performance because I don't know the call path. [09:21] And tests for slicing behavior. [09:27] fair enough [09:27] that method is /barely/ tested already; I'd like to nuke it entire for indexed_messages [09:27] but ETIME [09:28] I'll add some tests tomorrow morning === henninge_ is now known as henninge === wallyworld___ is now known as wallyworld