One-point discovery of ORACLE indexes (Requirements for indexes for different table join statements)

Source: Internet
Author: User

One-point discovery of ORACLE indexes (Requirements for indexes for different table join statements)
Two different table join statements are written: (the same effect) www.2cto.com select * from T_FORM_ELEMENT t join t_form_resources t1 on t1.meta _ id = t. meta_id;
Select * from T_FORM_ELEMENT t, t_form_resources t1 where t. meta_id = t1.meta _ id; The PK_T_FORM_ELEMENT index is created on the meta_id field of the T_FORM_ELEMENT table. 1. alter index PK_T_FORM_ELEMENT rebuild; 2. when the index is invalid: alter index PK_T_FORM_ELEMENT unusable; Conclusion: Statement 1: select * from T_FORM_ELEMENT t join t_form_resources t1 on t1.meta _ id = t. meta_id; indexes are used no matter whether the index is valid or invalid. Statement 2: select * from T_FORM_ELEMENT t, t_form_resources t1 where t. meta_id = t1.meta _ id; if the index is invalid, no index is taken. The SQL statement syntax is different, and the index reference degree is different.

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.