Merge lp:~zeitgeist/zeitgeist/bluebird-no-distinct into lp:~zeitgeist/zeitgeist/bluebird
Proposed by
Siegfried Gevatter
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Michal Hruby | ||||
Approved revision: | 356 | ||||
Merged at revision: | 358 | ||||
Proposed branch: | lp:~zeitgeist/zeitgeist/bluebird-no-distinct | ||||
Merge into: | lp:~zeitgeist/zeitgeist/bluebird | ||||
Diff against target: |
41 lines (+8/-7) 1 file modified
src/engine.vala (+8/-7) |
||||
To merge this branch: | bzr merge lp:~zeitgeist/zeitgeist/bluebird-no-distinct | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Michal Hruby (community) | Approve | ||
Review via email: mp+87175@code.launchpad.net |
To post a comment you must log in.
From #sqlite: ------- ------- ------- ------- ------- ----- ------- ------- ------- ------- ------- -----
-------
<RainCT> Hi. I've got a question: do .step() calls (internally) just look for the next row, or does the first .step() call already process everything?
<RainCT> Particularly, I'm wondering if removing a LIMIT from a query and instead aborting the while(... stmt.step() ...) once I've got enough will have any bad side effect
<#sqlite_guy> RainCT: technically, each step is actually executing code on the internal VM
<#sqlite_guy> I would say that if it makes sense to put in a LIMIT, then do so
<RainCT> #sqlite_guy: the problem is that the limit depends on another condition (a DISTINCT), but having SQLite check that makes the query 100x slower
<#sqlite_guy> how messy is the distinct?
<#sqlite_guy> could you throw an appropriate index on?
<RainCT> and I can really easily check that condition in code and count the number of things I got myself
<#sqlite_guy> honestly, you're up in the realm of personal taste/whatever works
<RainCT> #sqlite_guy: it's basically an integer ID which may be the same for a few consecutive rows
<RainCT> #sqlite_guy: Okay, thanks :). On benchmarks it seems to work fine, but I just wanted to make sure I'm not missing something.
<#sqlite_guy> nah
<#sqlite_guy> you're not missing anything
<#sqlite_guy> just make sure to hit sqlite3_reset when you're done with it
<#sqlite_guy> or finalize, obviously
-------