RDBPROD Choosing an index only retrieval
edited Jan 10, 2014 6:38AM in Rdb on OpenVMS, IBM zSeries and Oracle on OpenVMS (MOSC) 2 commentsAnswered
This is a hypothetical based on reality (and to see whether it is worth logging a call)
If I have a table with say 5 fields in it - A,B,C,D,E and I have two indices,
Ind1 (A,B) and
Ind2 (B,A,C,D)
both indices are unique.
IF I then do a query such as
SELECT C from TABLE WHERE A = 'xx' and B = 'XX';
is it reasonable to expect that the optimiser would always choose
to do an index only retrieval using ind2 and not use ind1 and direct read of record ?
Is there some circumstances where the optimiser would be right to choose ind1 and
If I have a table with say 5 fields in it - A,B,C,D,E and I have two indices,
Ind1 (A,B) and
Ind2 (B,A,C,D)
both indices are unique.
IF I then do a query such as
SELECT C from TABLE WHERE A = 'xx' and B = 'XX';
is it reasonable to expect that the optimiser would always choose
to do an index only retrieval using ind2 and not use ind1 and direct read of record ?
Is there some circumstances where the optimiser would be right to choose ind1 and
0