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.
This question is marked "community wiki".
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.
answered 26 Apr '13, 13:27
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.
answered 26 Apr '13, 10:23