How to troubleshoot index problems with char types in Oracle

Source: Internet
Author: User

In many scenarios, the following is the case

= Trim (b.colunm2)

How should we optimize it?

Many of the reasons for using TRIM are that some systems, in order to improve query efficiency, do not use ORACLE's unique, excellent, and never-before-defined VARCHAR2, but use the CHAR type to write dead character lengths.

Therefore, in the associated query when depressed, the newly established table on the use of VARCHAR2, if you do not TRIM off the CHAR type of space bar, there is no way to match, if used trim bar, the index is destroyed.

Also, the point is that while adding a trim (COLUNM1) index can improve lookup efficiency, it also increases storage space and affects write efficiency.

What to do!!!! What to do!!!

Fortunately you read my article, because my intelligence, think of the way to fill the blanks:

Rpad (a.colunm1,' character length ',' space '= b.colunm2

Is this a perfect solution?

Efficiency also times high!

Later found that this is not my original, Baidu has a long time ...

How to troubleshoot index problems with char types in Oracle

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.