Fuzzy query in Oracle _ MySQL

Source: Internet
Author: User
Fuzzy query in Oracle the Oracle database supports fuzzy query of strings in a format similar to '% interface %.

In order to draw a conclusion that the query speed is fast or slow, the following experiment is performed:

(1) a 0.1 million-record table is generated on Mr Zhao's machine, but it only has a field with a length of 1000 and VARCHAR.

(2) the following section is written in the VB program:

Dim db As New ADODB. Connection

Dim adoPrimaryRS As New ADODB. Recordset

Db. CursorLocation = adUseClient

Db. Open "PROVIDER = MSDASQL; driver = {Microsoft ODBC for Oracle}; server = zl; uid = zlhis; pwd = his ;"

AdoPrimaryRS. CursorLocation = adUseClient

AdoPrimaryRS. CursorType = adOpenStatic

AdoPrimaryRS. LockType = adLockBatchOptimistic

Debug. Print Time, Timer

Set adoPrimaryRS = db. Execute ("select NAME from TEST where name like '% China % '")

Debug. Print Time, Timer

(3) after multiple operations, change the matching string to '% 111111',' % aklsdjflsasdfasd % ', and so on. it is found that the time consumed fluctuates between 5-10 seconds, the value is related to the length of the matching string and the number of returned Records. It has little to do with the CursorLocation and other attributes of the record set.

(4) later I changed the matching string to a format like '123'. the result usually takes about 3 seconds and is relatively stable.

(5) Finally, I changed the matching string to a format like '% 34', and the result took about the same time as' % 123.

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.