My best DB days are long behind me (DB2), and I've done very little with sqlite so take this with a big pinch of salt, but seems to me that given your queries, an index in (Real_?)Events.Id is doing you no good at all.
I'd be tempted to try adding an index on (at least) the date field. (And possibly dropping the one on Id.)
As far as your HoAs is concerned, it might be worth considering sorting the arrays by data and using a binary search.
I suspect that this thread has gotton too deep to be getting the eyeballs you really need to get good suggestions for this problem. If you can find the time, you might try consolidating the information you've given in this sub-thread and making a post to the sqlite mailing list asking for the best way to optimise those queries.
With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
|