ORACLE 12C Same Columns Create multiple indexing methods

Source: Internet
Author: User
Tags create index oracle database

Starting with Oracle 12C allows different types of index to be created on the same column for performance tuning, with different types of index mainly including (B*tree vs bitmap,local vs Global)
ORACLE 11G

The code is as follows Copy Code

Sql> select * from V$version;


BANNER

--------------------------------------------------------------------------------

Oracle Database 11g Enterprise Edition release 11.2.0.3.0-production

Pl/sql Release 11.2.0.3.0-production

CORE 11.2.0.3.0 Production

TNS for Linux:version 11.2.0.3.0-production

Nlsrtl Version 11.2.0.3.0-production

sql> CREATE TABLE T_xifenfei

2 (

3 EMPNO Number (9) PRIMARY KEY,

4 EmpName VARCHAR2 () not NULL,

5)

6/

Table created.

Sql> CREATE INDEX emp_dept_btree_idx on EMP (DEPTNO);

Index created.

sql> CREATE BITMAP INDEX emp_deptno_bitmap_idx on EMP (DEPTNO) invisible;

CREATE BITMAP INDEX emp_deptno_bitmap_idx on EMP (DEPTNO) invisible

*

ERROR at line 1:

Ora-01408:such column list already indexed


ORACLE 12C

Cdb_pdb@chf> select * from V$version;

BANNER con_id

-------------------------------------------------------------------------------- ----------

Oracle Database 12c Enterprise Edition release 12.1.0.1.0-64bit Production 0

Pl/sql Release 12.1.0.1.0-production 0

CORE 12.1.0.1.0 Production 0

TNS for 64-bit windows:version 12.1.0.1.0-production 0

Nlsrtl Version 12.1.0.1.0-production 0

cdb_pdb@chf> CREATE TABLE T_xifenfei

2 (

3 EMPNO Number (9) PRIMARY KEY,

4 EmpName VARCHAR2 (not NULL)

5)

6/

Table has been created.

The code is as follows Copy Code


Cdb_pdb@chf> CREATE INDEX emp_dept_btree_idx on EMP (DEPTNO);

The index has been created.

The code is as follows Copy Code

cdb_pdb@chf> CREATE BITMAP INDEX emp_deptno_bitmap_idx on EMP (DEPTNO);

CREATE BITMAP INDEX emp_deptno_bitmap_idx on EMP (DEPTNO)

*

Line 1th Error:

ORA-01408: This column list is indexed


cdb_pdb@chf> CREATE BITMAP INDEX emp_deptno_bitmap_idx on EMP (DEPTNO) invisible;


The index has been created.

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.