Results 1 to 2 of 2

Thread: Doubt in Index

  1. #1
    Join Date
    Mar 2004
    Location
    India
    Posts
    41

    Unanswered: Doubt in Index

    Hi EverB,


    I have created a table say T1 with 5 columns (col1......col5).
    I have created an index on col4 and col5.

    iam executing a select query say.

    select col1,col2,col3 from t1 where col1 =0;

    In the above query i hav not used the columns for which i hav created the index.My ques is-

    Does the index really works when u execute the above query?

    Any answer please.........
    It wuld be better if u culd suggest some sites for this.

    Thanks and Regds,
    Arun

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    no, for that query, the index is ignored

    a good tutorial is Optimizing your MySQL Application even if you're using something other than mysql
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •