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
guydor
Posts: 65
Registered: ‎05-15-2011
My Device: 9700
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!
Please use plain text.
Developer
YamilBracho
Posts: 713
Registered: ‎05-31-2010
My Device: 8520

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

Please use plain text.
Regular Contributor
guydor
Posts: 65
Registered: ‎05-15-2011
My Device: 9700

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?
Please use plain text.
Developer
YamilBracho
Posts: 713
Registered: ‎05-31-2010
My Device: 8520

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 

Please use plain text.