Thuta Learning
MongoDB
AdvancedData & Databasesအလယ်အလတ်

Indexes

MongoDBသင်ခန်းစာ 15

Indexes များသည် MongoDB ၏ query performance ကို မြှင့်တင်ရန် အထူး data structures များဖြစ်သည်။ Index မရှိပါက MongoDB သည် collection တစ်ခုလုံးကို scan လုပ်ရသည် (collection scan)။ Index ရှိပါက query သည် index ကို အသုံးပြုပြီး data များကို ပိုမိုလျင်မြန်စွာ ရှာဖွေနိုင်သည်။

javascript
// Create a single field index on the 'item' field
db.inventory.createIndex( { item: 1 } )

// 1 for ascending order, -1 for descending order
You should see
(item field တွင် index တစ်ခု တည်ဆောက်ပြီးသွားမည်။ ဤ field ဖြင့် ရှာဖွေပါက ပိုမိုမြန်ဆန်လာမည်)

နောက်ဆုံးပြင်ဆင်ရက်

Progress ကို ဤ browser (ဤစက်) တွင်သာ သိမ်းထားပါသည်။ အခြားစက်များနှင့် sync မလုပ်ပါ။

ဤသင်ခန်းစာတွင် အမှားတွေ့ပါက အကြောင်းကြားရန်သင့် email app ကို ဤသင်ခန်းစာလိပ်စာ ဖြည့်ပြီးသားဖြင့် ဖွင့်ပေးပါမည် — သင်ကိုယ်တိုင် ပို့မှသာ ပို့မည်ဖြစ်သည်။

Indexes | Thuta Learning