Magic SQLite table join (contactsprovider)

Source: Internet
Author: User

Customizes the URI of a telephone query, and uses raw_contacts, data, and phone_lookup to query Qualified Data.

At the beginning, I directly used sql1:

Select * From raw_contacts inner join phone_lookup on...
Inner join data on...

 

It takes only 50 milliseconds to query 7000 pieces of data on sqlspy, but it takes nearly 20 seconds to query the data on the mobile phone.

The difference between data and phone_lookup is compared. raw_contacts inner joins data directly. As a result, it takes less than 1 second to query the result on the mobile phone. I only wanted to use these two tables, but considering that the phone number contains special characters, I continued to think about it.

Looking at raw_contacts inner join data, the flash suddenly flashed and changed phone_lookup to sql2:

Select * From raw_contacts inner join data on...
Inner join phone_lookup on...

 

The result is correct and the speed is very fast. It's amazing.

But what's even more amazing is that the speed of the result on the mobile phone is less than 1 second after SQL 1 is combined into another query.

It seems that in the future to do SQLite, we need to do more operations and try several connection methods.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.