I have a fairly simple selection statement,
select column 4 of table_x where column1 =: 1 and column2 =: 2 and column3 =: 3
Columns 1, 2 and 3 are the main key of the table.
For some reason, instead of using the primary key index, oracle uses a non-clustered index that only contains 1 of the columns.
The only thing I can find out why the optimizer ignores the primary key index, is that the link variables used in the query are not defined in the same way as the columns. The linking variables are defined as varchar (32), the columns are nchar, number and nchar. Is this mismatch enough to prevent the optimizer from using the primary key index?
The statistics have been updated in the table and all the indexes.