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?

130 pts.
Tags:
AS/400 database
AS/400 DB2
SQL Query
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

Answer Wiki

Thanks. We'll let you know when a new response is added.

<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

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following