There is no small problem with data filtering.

Source: Internet
Author: User

The problem is as follows:

Assume that the information is stored in the mysql database. As shown in the following figure, the information heap of Table A is A million-level information heap (each piece of information is not long and generally 20 characters long and is A short word ), B is a common message (about 500 characters in length, which of the following is the most effective way to determine whether B contains information in heap A and return the information contained?
A solution is provided here. If you have a better solution, you are welcome to leave a message!
Because the data volume of information heap A is large and stored in the database, A simple solution is generated, which is directly solved by an SQL statement. Of course, this will lead to A problem that is SQL optimization, how to Reduce the search time depends on your own optimization methods. The query SQL statement is as follows: select GROUP_CONCAT (matching table field) content from table name where instr (B table information, matching table field)> 0
In addition, you can use full-text retrieval to increase the search speed.


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.