nemomobile/libcommhistory — pull request #60 by special (2013-11-22 04:16:11+00:00)
Title: [libcommhistory] Implement fetchMore for ConversationModel

This re-enables StreamedAsync mode for ConversationModel (despite that
it's not truly asynchronous, but nothing is right now). The model will
be populated incrementally as it's needed by the view.

The SQL query is also rewritten after a lot of research. SQLite cannot
use the table indexes for sorting if the query contains an IN or OR
expression, but the UNION ALL of several queries which search that index
is naturally in the right order, so it's very fast. This reduces the
query time for 120k events from 3+ seconds to <1ms.

The sort column is changed to startTime to match the index, but that
will likely be changed for all event queries in a subsequent patch.