Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Regular Contributor
Posts: 65
Registered: ‎05-15-2011
My Device: 9700
My Carrier: Att
Accepted Solution

Database Slow Performance

Hi,

I'm making use of a 5 mb SQLite db in my app, on app's 1st use the db is being copied to the device memory card.


The problem is that the db querying is very slow.

Any suggestions to performance improvments?


Thanks!
Developer
Posts: 713
Registered: ‎05-31-2010
My Device: 8520
My Carrier: Movistar

Re: Database Slow Performance

1) bring as litttle data as you can, refined your queries

2) create indexes in fields used in Where statements or Order By

3) Prepare your statements

Regular Contributor
Posts: 65
Registered: ‎05-15-2011
My Device: 9700
My Carrier: Att

Re: Database Slow Performance

Thank you for your answer. Can you please explain me what do you mean to "create indexes in field" ?

Also what do you mean prepare your statements?
Developer
Posts: 713
Registered: ‎05-31-2010
My Device: 8520
My Carrier: Movistar

Re: Database Slow Performance

sure.

1) Check in your select statmente which field are you sing in the Where/OrderBy clauses

2) Use your favourite SQLite manager and crete indexes in the table where you wanto to isuue a SELECT

3) To Prepare your statements use wildcard holders if you want to execute a query in a loop, and just use Bind to pass the parameters

 

Check http://docs.blackberry.com/en/developers/deliverables/8682/SQLite_overview_701956_11.jsp

http://docs.blackberry.com/en/developers/deliverables/8682/BP_Optimizing_SQLite_database_performance...

http://today.java.net/article/2010/03/17/getting-started-java-and-sqlite-blackberry-os-50