MySQL + SQL · Lesson 89
Primary Index और Secondary Index
दो तरह के Index
| Type | मतलब |
|---|---|
| Primary (clustered) | Primary key पर बना; physical row order तय करता है। Table में एक। |
| Secondary (non-clustered) | दूसरे columns पर extra index; row location की ओर इशारा। कई हो सकते हैं। |
मुख्य बात
InnoDB में primary key ही clustered index है — data physically primary-key order में store होता है। Secondary indexes पूरी row ढूंढने के लिए primary key रखते हैं।
सारांश
- Primary/clustered index = table में एक, row order तय करता है (primary key)।
- Secondary index = additional, दूसरे searched columns पर।