You still have not provided any info on the query you try to run against your database... some random thoughts:
- when you use any conditions, matching on a text field without index is pretty expensive CPU-wise
- when you fetch the whole DB, I'm pretty sure that after the first invocation, all the SQLite data will be in memory cache (by the kernel), hence the subsequent runs are fast
You should profile it, or - to say the least - put some comments in to see where your program takes the most of the time.