105 pts.
 How would we know which index is been used during Native IO reads or SQL query execution happens on that file during program is being run?
For example on an as/400 Data base file, some 10 indexes are created? How would we know which index is been used during Native IO reads or SQL query execution happens on that file during program is being run?

Software/Hardware used:
OS 400
ASKED: June 24, 2010  10:53 AM
UPDATED: June 25, 2010  12:02 AM

Answer Wiki:
<i>How would we know which index is been used during Native IO reads...</i> You look at the programming to see what index was specified. Native I/O does exactly what you tell it to do. If the programming is for index A, then that's the index that will be used. <i>...or SQL query execution...</i> For SQL, it's a bit harder to tell. It can change on different days depending on index statistics, past usage patterns, the DB2 version/release and possibly other factors. Run the process in debug to see what the resulting messages tell you. Usually, the same indexes will be used; it just isn't guaranteed. And, of course, appropriate indexes can often be determined simply by looking at the SQL and at the available indexes to see if any are an obvious match. Tom
Last Wiki Answer Submitted:  June 25, 2010  12:02 am  by  TomLiotta   108,055 pts.
All Answer Wiki Contributors:  TomLiotta   108,055 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _