DB2: Optimizer not using any indexes

Tags:
AIX
IBM DB2
I have DB2 version 8.2 installed in AIX one thing I am seeing is strange that optimizer not using any indexes. In any simple join index are not being used. Is there any parameter which needs to be set up?

Answer Wiki

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

The optimizer relies on accurate statistics for your data. If you didn’t set up automatic statistics (give a look here) you must run the utility RUNSTATS to populate your metadata (catalog) with them.

This, of course, assumes that the indices are on the keys(columns) that you are joining on or searching on.

Discuss This Question: 1  Reply

 
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
  • AshishSingh10
    Hi,

    An index is a structure that exists physically on disk. The only type of index that is supported by DB2 is B-tree style.

    Index can be created by using the below mentioned code: -
    CREATE UNIQUE INDEX CORP.PRODIND
     ON CORP.PRODUCTS
      (BARCODE ASC)
     PADDED
     USING STOGROUP GROUP1
      PRIQTY 512
      SECQTY 64
      ERASE NO
     BUFFERPOOL BP1
     CLOSE YES
     PIECESIZE 1 M;

    Thanks and regards
    Ashish@S
    875 pointsBadges:
    report

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