Install the progressive web app on your phone
Learn more
X
Info
Open the page on your phone
Home
Clustered and Non-Clustered Indexes in MySQL
Download
Related branches
Clustered and Non-Clustered Indexes in MySQL
Clustered index:
One per table.
Physically organizes data on disk.
Used for the primary key (or unique index if the primary key is missing).
Provides fast access to records by key value.
Example: `
PRIMARY KEY (id)`
.
Non-clustered index:
Can be many per table.
Does not affect the physical location of data.
Used to speed up searches on fields that are not part of the clustered index.
Consists of two parts: a B-tree and an overflow list.
Example: `
INDEX (name)`
.
Differences: