what the difference between Create single-column index & Create composite index

Discussion in 'MySQL' started by dineshsingh1984, Nov 14, 2015.

  1. #1
    what the difference between Create single-column index & Create composite index in mysql. when we create the table and assign index then show two option :
    1>Create single-column index,
    2>Create composite index.
     
    dineshsingh1984, Nov 14, 2015 IP
  2. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #2
    Composite index is an index on multiple columns. In a WHERE clause, it will be used if either the first column is a condition or both columns are a condition, but not if only the second column is a condition.
     
    jestep, Nov 16, 2015 IP