on 2013 Apr 26 1:38 AM
hi i am trying to load about 10K rows for my iphone app. iam getting huge performance problem while retrieving data. i am fetching data column by column by referring sybase tutorials. Like following code i'm trying to load 45 columns of the table.
lrs_resultSet->GetString("acc_alter_code", acc_alter_code, 21);
is this the correct way? please help me out in this. It is taking 5 secs to create an array of 10K.
Hi Sudha,
There is an optimization you can do. GetString() comes in two flavours: one which takes a column id and one which takes a column name (as in your example). The column name one is convenient, but it means UL must look up the column name for each value you fetch. For code which must run quickly/many times, it's faster to use the column id. You can get the column id by using ULResultSetSchema's GetColumnID() function - query it for each column and reuse the ids for all of your Get calls. Or you can just hard-code the column id (they start at 1, matching your query) since you know what the select statement is.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Iam using KVC for loading all the columns of the table. So I have created properties in a class for each column. So for matching the column name and property i have used column name flavour of GetString(). I have tried for Column id's also, I have tried to loop through all the columns and took id's and its name and tried load 10K, it was taking 2 secs more than previous method.
In order for the optimization to work, you must fetch (and save) the column ids only once for all the rows you are fetching...
It would be of great help if you posted the schema (including indexes) of the table(s) involved and the SQL query you are using.
Also please post the version and build number of UltraLite you are using.
Can you check how much free memory the phone has with the database installed? Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
62 | |
10 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.