Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7891013
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T06:30:30+00:00 2026-06-03T06:30:30+00:00

I have strange issue with SQLite on iOS 5. In iOS application I have

  • 0

I have strange issue with SQLite on iOS 5.

In iOS application I have pretty big table (1 000 000 + records).
I have simple query for fetching about 20 000 records from the table and then I am sorting result via ORDER BY statement. Something like this:

SELECT table2Field,table3Field,table4Field,table5Field,probability,impact 
FROM table1 
    INNER JOIN table2 ON id2=table1_id2 
    INNER JOIN table3 ON id3=table1_id3 
    INNER JOIN table4 ON id4=table1_id4 
    INNER JOIN table5 ON id5=table1_id5 
WHERE country_id = 0 AND category_id = 0 
ORDER BY table2Field, table3Field, table4Field, ABS(impact) DESC

On the iOS 4 this work around 2-3 seconds. However on the iOS 5 it works more then minute.
I was trying to identify root cause for this issue, but I have no success.
Interesting fact is if I remove ORDER BY statement from the query everything works fine.

Any one have better solution then sorting data manually?

Thanks,
Artem.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T06:30:32+00:00Added an answer on June 3, 2026 at 6:30 am

    It’s likely that the new version of SQLite in iOS 5 has simply chosen a less efficint query plan than the version in iOS 4 did. You can use EXPLAIN QUERY PLAN in each of the versions to see if there are obvious differences. Perhaps the earlier version uses an index that is not used by the later version.

    You can also try using ANALYZE to give the query planner better information, and try EXPLAIN QUERY PLAN again.

    Sometimes adding/changing an index will help with ORDER BY queries.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'am building simple Ajax application (via jquery). I have strange issue. I found where
I have a really strange issue. I am working on a Java SWING application
Strange issue I am having with my MVC3 project. I have followed a simple
I have strange issue. My application have multiple activitys, on one activity is setting
I have a strange issue with an Asp.NET MVC application. Using Asp.NET MVC 3
I have this strange issue. When I run application from Xcode (even on device),
I have this strange issue. I have an image which I rotate about a
We have a strange issue with running an Facebook IFrame application (using MVC 2).
I have a strange issue in my GWT app. My application is working fine
I have a strange issue on ios 4.3.I have one of my screen in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.