We can using Index to tunup performance in database
and for more performance in Oracle we can use HINT for select index when query witch example below
and for more performance in Oracle we can use HINT for select index when query witch example below
Example to create index
field_a create index name indx_a
field_b create index name indx_b
field_a create index name indx_a
field_b create index name indx_b
When Query data
select * from my_table where field_a='xxx';
select * from my_table where field_b='xxx';
The result is good time response ... very fast
select * from my_table where field_a='xxx';
select * from my_table where field_b='xxx';
The result is good time response ... very fast
But when using this query
select * from my_table where field_a='xxx' and field_b='yyy';
Can see it's response is not good ... slowly
Can see it's response is not good ... slowly
I was very confused that why it's not good when we were both of index field in ?
How ever i try to tune up index whtch below it's ok good response and very fast
create index indx_ab on my_table (field_a,field_b)
How ever i try to tune up index whtch below it's ok good response and very fast
create index indx_ab on my_table (field_a,field_b)
I try to research and fron the HINT we can using HINT to select INdex for example below
select /*+INDEX(mt,indx_a)*/ * from my_table mt where field_a='xxx' and field_b='yyy';
It's to fast when query witch no need to create additional index .