Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Choosing the right index in a SELECT statement

Choosing the right index in a SELECT statement

Choosing the right index in a SELECT statement


A table has an index on two fields (not the unique index).
When selecting data using the fields of the index the system performs a sequential scan.

Can I tell informix to use the index I want it to Use ?


RE: Choosing the right index in a SELECT statement

The select statemnt which use should have the same key sequence, then the informix will automaticaly refer to the related index. For E.g:

If you have two indexes one on emp_code field and the other one on grade_code.

The select statment

    select * from employee_mast
    where emp_code = "1057";

will refer the emp_code index. If you want to refer to all the rows of a select statemnt, you can specifiy some query which selects all the rows like this
     where emp_code matches "*";


RE: Choosing the right index in a SELECT statement

Thanks for helping out.

I've Updateted the statistics of the table and now the select statement chooses the right index.


Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close