Rajat Sharma
Member
Hello everyone, hope you all are well!!
I have a little confusion with FIND LAST/FIRST statement. I think, indexes are stored in ascending order if we define them as “A” otherwise in descending order with “D” (please suggest). So basically FIND LAST and FIRST will search (index or table search) from bottom to top or top to bottom respectively (no matter how indexes are stored). So in equality matching, if we are doing find last/first then does that make any difference (I think it shouldn't) because it will search all the records(please suggest).
For example:
In above code: c-num, c-val, c-seq are part of one index (KEY) and defined in the same order. All the index fields are of type “A”. So is there any specific reason that when should we use LAST or FIRST.
Apart from this, I read about idxbuild, idxfix and idxcheck but I didn't understand that how could I use these utilities to increase performance. Are these utilities should only use by DBA (please suggest).
Thanks & Regards!
Rajat.
I have a little confusion with FIND LAST/FIRST statement. I think, indexes are stored in ascending order if we define them as “A” otherwise in descending order with “D” (please suggest). So basically FIND LAST and FIRST will search (index or table search) from bottom to top or top to bottom respectively (no matter how indexes are stored). So in equality matching, if we are doing find last/first then does that make any difference (I think it shouldn't) because it will search all the records(please suggest).
For example:
Code:
FIND LAST c-data
WHERE c-num = l-num
AND c-val = l-value
AND c-seq = l-seq.
In above code: c-num, c-val, c-seq are part of one index (KEY) and defined in the same order. All the index fields are of type “A”. So is there any specific reason that when should we use LAST or FIRST.
Apart from this, I read about idxbuild, idxfix and idxcheck but I didn't understand that how could I use these utilities to increase performance. Are these utilities should only use by DBA (please suggest).
Thanks & Regards!
Rajat.