Index एउटा छुट्टै, sorted data structure (InnoDB मा B-tree) हो जसले MySQL लाई सिंगो table स्क्यान नगरी rows भेट्न दिन्छ। यो नभए, एउटा lookup ले हरेक row पढ्छ (एउटा full table scan); यो भए, यसले केही चरणमा tree हिँड्छ।
Primary बनाम secondary
InnoDB मा table आफैँ primary key index हो — एउटा clustered index। Rows भौतिक रूपमा primary-key क्रममा भण्डारण हुन्छन्, त्यसैले primary key lookup सिधै पूर्ण row मा पुग्छ।
एउटा अन्य column(s) मा keyed गरिएको छुट्टै B-tree हो। यसका leaf nodes ले indexed मान र भण्डारण गर्छन्, त्यसैले secondary index प्रयोग गर्दा प्रायः row को बाँकी भाग ल्याउन दोस्रो lookup ("back to the clustered index") को खर्च लाग्छ।
