My thoughts exactly, I bet my old n95 phone would be able to return 5000 records in a reasonable timeI can't understand why you have the same sample taking from 0 to over 50 seconds. Could it be a disk problem? Defragmentation? Or a memory problem?
Or perhaps the marshalling is a bit of a performance killer (didn't yet investigate, but it could be...)
Do we need all the columns (i see a select * done, and I can imagine the calculation time will scale linearly with the number of columns involved)?
Didn't check the logs but I'm assuming no busy retries are done?
If this all fails to get the expected improvement, perhaps we can come up with some pagination scheme? (Although pagination and databases aren't exactly the best of friends...)
And do you really want all those 5000+ entries in one list in mediaportal? that doesn't seem very useful at first sight, but can surely increase the memory usage of your system (possibly starving the sqlite part...)