Database full-text indexing related issues

Source: Internet
Author: User

Courses . net/c# Course [4]:sqlserver Basic application Development from the basis for you to explain the relevant use of the data table, and the index in the data table is a necessary grasp :

How to add

Selectipfromtabelxwhereiplike '%192.168.0.1% '

This sentence is optimized for performance.

Indeed, using the like%x, the database has no way to use the index, it is bound to scan the whole table, so we need to avoid this method. My former colleague asked me to try the match () against method. So I tried it by the way,

Full-text indexing only supports MyISAM tables

Select*from ' data '. ' Test ' Wherematch (IP) against (' 192 ')

So the search came out with no results. Google for a while, found that online examples are search English words, so in the IP mixed a little English words tried, there is the result.

After Google found, MySQL default to full-text search has the word character limit, that is:

Ft_max_word_len 84

Ft_min_word_len 4

So the ip here can't be searched because of the. Separated will be treated as a word, IP only 3 bits.

So I changed the Ft_min_word_len to 1, restarted the service, repaired the table, rebuilt the index, and the search succeeded.

This is not a supported search IP,IP search generally saves the IP address into UNSIGNED INT and then searches with the conversion function.

Database full-text indexing related issues

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.