Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

What kind of index is this ?

Peasant81Dec 5 2023

In some of my PDBs, I see indexes like below; the one with the comment "Index1" below with some BINARY_AI thing.
It is created on the primary key column. Are these indexes even useful ?

But, the primary key itself uses another index (PALLET_DETAIL_IDX2) to enforce the primary key.

--- Needless to say, it is a table with lots of columns in my real-life scenario
CREATE TABLE PALLET_DETAIL (PALLET_ID VARCHAR2(64 CHAR) NOT NULL);

-- Index1
CREATE UNIQUE INDEX PALLET_DETAIL_IDX1 ON PALLET_DETAIL(NLSSORT(PALLET_ID,'nls_sort=''BINARY_AI'''));

-- Index2
CREATE UNIQUE INDEX PALLET_DETAIL_IDX2 ON PALLET_DETAIL(PALLET_ID);

ALTER TABLE PALLET_DETAIL ADD (CONSTRAINT PALLET_DETAIL_PK PRIMARY KEY (PALLET_ID) USING INDEX PALLET_DETAIL_IDX2 ENABLE VALIDATE);
This post has been answered by Solomon Yakobson on Dec 5 2023
Jump to Answer
Comments
Post Details
Added on Dec 5 2023
5 comments
156 views