Complex query of big data tables

Source: Internet
Author: User

Now:

 

1. The data volume of the table to be queried is large;

2. A large amount of data is returned;

 

Complexity is reflected in:

1. Associate the data of multiple big data tables for query.

2. query conditions are also complex.

 

For example:

Tianyi reading has a user portrait group function.

Users must be filtered to different user groups based on their behaviors.

User table: about 10 million data

User subscription and consumption data: possibly hundreds of millions of data

User Login data: may also contain hundreds of millions of data

User reading e-book data: hundreds of millions

Users read e-book content data: hundreds of millions

 

We need to count the data of the above user behaviors within three months. For example, the purchase volume of consumption data is greater than 30, less than 50, and the consumption amount is greater than 100, less than 300. In this case, how can we implement queries?

 

You can use sharded table queries and write the results directly to oneTemporary table.

 

For example, if the number of orders for data consumption in three months is greater than 30, and less than 50 users are imported to a temporary table, users with query results of other conditions are also placed in a temporary table, finally, the final result is obtained after these temporary tables are joined.

 

FinallyStored ProcedureDirectly store the results in the database.

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.