-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Too slow when do the big table join #130
Comments
Person.home is an integer in the DB definition. so SQLite performs and unordered index scan on the Home table. Changing the definition of Person.home to TEXT sped the query up to 0.032s. |
Can you post your object definition for Person, so we can have a look. |
Thanks, I know where that bug will be. I probably assume that all related tables have an "int" primary key. |
ok, is there any easy fix? |
if ([testClass isSubclassOfClass:[SRKEntity class]]) { |
I just have to check that |
@yc-zhu, sorry saw you suggested just that in your comment. |
MyDatabase.zip
The database query is very slow when do the join with two table(20k records, need about 4 minutes), i tried to use the DB Browser for SQLite to access the same database file and get the same result. But in our android team, they use another ORM library to generate the database, the data access is fast(the same query only need about 100ms). is there any parameter need to be changed when generate the database file?
Attached the database file, and the left join statement is:
select Person.name , Home.address from Person left join Home on Person.home = Home.Id
The text was updated successfully, but these errors were encountered: