# Composite Index

+ Composite indexes follow the leftmost matching principle when used in searches
```
CREATE TABLE t2 (
id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
c1 INT NOT NULL,
c2 INT NOT NULL,
c3 INT NOT NULL,
key idx_t2 (c1, c2, c3)
);
```
------------------------------------------------------------
composite index
- Composite indexes follow the leftmost matching principle when used in searches; that is, leftmost first, when retrieving data, starts from the leftmost side of the composite index; only valid if the value of the leftmost column of the index is determinable that this column index is one of the many column indexes

```
CREATE TABLE t2 (
id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
c1 INT NOT NULL,
c2 INT NOT NULL,
c3 INT NOT NULL,
key idx_t2 (c1, c2, c3)
);
```
