Oracle 12C multi-index with the same column

Source: Internet
Author: User

Oracle 12C multi-index with the same column

In Oracle 12c, Oracle provides the ability to create different indexes on the columns of the same table for SQL Performance Optimization, but only one index is visible.

The following is an example
Connected:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0-64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SQL> alter session set container = pdb1;

Session altered.

SQL> CREATE TABLE t (
2 id NUMBER,
3 ename VARCHAR2 (50)
4 );


Table created.


SQL> CREATE INDEX t_idx1 ON t (ename) VISIBLE;


Index created.


SQL> CREATE INDEX t_idx2 ON t (ename) INVISIBLE;
Create index t_idx2 ON t (ename) INVISIBLE
*
ERROR at line 1:
ORA-01408: such column list already indexed

 


SQL> CREATE BITMAP INDEX t_idx3 ON t (ename) INVISIBLE;


Index created.
SQL> l
1 SELECT a. index_name,
2 a. index_type,
3 a. partitioned,
4 B. partitioning_type,
5 B. locality,
6 a. visibility
7 FROM user_indexes
8 left outer join user_part_indexes B ON a. index_name = B. index_name where a. table_name = 'T'
9 * order by index_name
SQL>/


INDEX_NAME INDEX_TYPE PARTITIONED PARTITIONING_TYPE LOCALITY VISIBILITY
-----------------------------------------------------------------------------
T_IDX1 NORMAL NO VISIBLE
T_IDX3 BITMAP NO INVISIBLE

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.