974908 wrote:WHY MY INDEX IS NOT BEING USED
I created the table
CREATE TABLE TABLE_AAA
COLUMN1 NUMBER(19) NOT NULL
, COLUMN2 VARCHAR2(20)
, COLUMN3 VARCHAR2(20)
, CONSTRAINT TABLE_AAA_PK PRIMARY KEY
I created the index
CREATE INDEX INDEX4 ON TABLE_AAA ("COLUMN2")
if I run the query
select column1, column2, column3 from table_aaa where column2 = 'sss'
the explain plan show TABLE_AAA FULL
while if execute
select column2 from table_aaa where column2 = 'sss'
the explain plan show INDEX4 RANGE SCAN
because in the first case does not use the index?