On Wed, May 20, 2009 at 2:50 PM, Sublimity Mobile Software < [email protected]> wrote:
> > My current database layer is used to convert query results into bean > objects. I did a test and the results where: > > Total time loading queries = 15273ms > Queries executed = 561 > Executing All Queries = 3781 ( ~25% of the total time ) > GetCount() method uses = 7291ms ( ~48% of the total time ) > Loaded Objects = 1120 > > It uses 7291ms of the total 15273ms loading the data into the cursor > through using the getCount() method. I can not remove any columns from > the query as you suggested because i need those values in my bean > objects. > > Any suggestions? I'm assuming that when you say that "executing" the queries takes 3781 ms, you mean that that's how long the calls to query() take. That's not where the query is actually executed though. Calling query() essentially compiles a sqlite3 query program to do your query. It's not until you start fetching the data that the query is actually run (which would be as a result of calling getCount(), moveToNext(), or whatever the first method is that you call). That being said, 27 ms on average per query doesn't seem bad at all. It seems like your problem is the number of queries you run, not necessarily how long each query takes. I suggest making your queries return more data at once, preferably all of it. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

