Please Explain me what is difference between cluster and non-cluster index.
Also if i create a primary key on a Table which index will be created automatically, cluster or non cluster.

Thanks in advance.

Recommended Answers

All 5 Replies

In MySql a cluster is several servers working together. Unless you are working in that environment, your question is meaningless. I have no direct knowledge of how MySQL clusters work, but a quick look here: leads me to believe that from the user's perspective you don't have to care. I could well be wrong, though.

A clustered index is a special type of index that reorders the way records in the table are physically stored. Therefore table can have only one clustered index. The leaf nodes of a clustered index contain the data pages. Clustered index will be created by default when u create primary key on a column. clustered index is stored in
serial passion.

A nonclustered index is a special type of index in which the logical order of the index does not match the physical stored order of the rows on disk. The leaf node of a
nonclustered index does not consist of the data pages. Instead, the leaf nodes contain index rows. Non clustered index will be created automatically when u create unique key on a column. A table can have no.of unique keys, so we can create no.of non clustered indexes
per table.

thanks for the info QB.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.