I have used sql select query in android app which works fine on newer versions of android i.e it takes 30 to 40 seconds on Samsung galaxy tab( android 4.0.3) to retreive data from sqlite database, but on device with older version of android 2.3 it takes 18 minutes to retreive data. If i remove "order by x_unitperson.UNITSEQ" then its performance do not decreases on android 2.3. How can i increase its performance on android 2.3 without removing order by clause.
My sql is:
SELECT PERSON_ID,
COMMANDER,
CITIZEN,
RANK,
GIVEN,
SURNAME,
ISOR,
(SELECT GROUP_CONCAT(NAME_SHORT, '\n')
FROM units
INNER JOIN
(SELECT *
FROM x_unitperson
WHERE PERSON_ID = people.PERSON_ID
ORDER BY x_unitperson.UNITSEQ) AS xunits
WHERE units.UNIT_ID = xunits.UNIT_ID) AS NAME_SHORT,
(SELECT FNAME
FROM photos
WHERE PERSON_ID = People.PERSON_ID) AS FNAME
FROM people
ORDER BY SURNAME,
GIVEN
.
stackoverflow.comm
No comments:
Post a Comment