Question : Oracle Query Tuning

If in a table, a column already has unique index or it has a primary key.
If I create an index on top of this, Will this be worth?

If a table has  table-level primary key, composed of two columns.
and if I create an index on only one column, what will be the impact?
Will there be any performance issues

Answer : Oracle Query Tuning

Dear Sakthi,

There is no rule of thumb in database performance tuning.  See this

Table1(col1,col2,col3) primary key(col1,col2)
Note behavior of each query listed below

sql>select * from table1 where col1=1 and col2=1
will may use primary key index(Index scan)

sql>select * from table1 where col1=1
will may use primary key index(Index scan)

sql>select * from table1 where col2=1
will may use primary key index (index Skip scan, but again this is depend)

To feel this create table with primary key and examine execution plan for different query.


Random Solutions  
 
programming4us programming4us