Today I have encountered a surprising fact:
Scenario is 10.2.0.1 Express Edition on Win32.
I have a table called job_history in the HR scheme which has a composit primary key : and there is an index for the primary key:
SQL> select index_name from user_indexes where table_name=’JOB_HISTORY’;
INDEX_NAME
Does the following info help to explain?
——————————
JHIST_EMP_ID_ST_DATE_PK
JHIST_JOB_IX
JHIST_EMPLOYEE_IX
JHIST_DEPARTMENT_IX
This is my constraint in the data dictionary:
SQL> select column_name , position
2 from user_cons_columns
3 where constraint_name=’JHIST_EMP_ID_ST_DATE_PK’;
COLUMN_NAME POSITION
———————– ———————————
EMPLOYEE_ID 1
START_DATE 2
Now I drop the primary key constraint
SQL> alter table job_history drop constraint
2 JHIST_EMP_ID_ST_DATE_PK including indexes;
Table altered.
And here is the surprise:
SQL> select index_name from user_indexes where table_name=’JOB_HISTORY’;
INDEX_NAME
——————————
JHIST_EMP_ID_ST_DATE_PK
JHIST_JOB_IX
JHIST_EMPLOYEE_IX
JHIST_DEPARTMENT_IX
I do not see the point here. Why is the index still there?
Evern though I have explicitly written INCLUDING INDEXES.
BUG or Feature?!
Can anyone explain?

Posted by Lutz Hartmann