AI ML DL
@AIMLDL1
Followers
2
Following
10
Media
0
Statuses
49
Joined December 2018
Full benchmark, execution stats, and reasoning here 👇 https://t.co/EFJImfD9Pn
#MongoDB #DatabasePerformance #BackendEngineering
medium.com
Are mongoDB guidelines are best for all queries or we need to do our research on indexes
0
0
0
Takeaways: • ESR is a guideline, not a rule • Cardinality > theoretical order • Multi-key fields amplify scans • Always benchmark with real data
1
0
0
Putting a bounded, selective field early in the index reduces seeks drastically. ESR ignores: • cardinality differences • multi-key fan-out • $in behaving like range at scale
1
0
0
Quick math: • age=40 → ~25K docs • 1 departmentId → ~300 docs • 250 departmentIds → ~75K docs Index order decides when MongoDB can prune this search space.
1
0
0
Why ESR failed here 👇 • departmentId is multi-key (array) • salary has very high cardinality • $in with 250 values behaves like a range query This explodes index scans.
1
0
0
Surprise: The ESR-correct index performed the worst in terms of keys examined and execution time. The fastest index was: {age, departmentId, salary}
1
0
0
I tested 4 compound indexes: • {age, salary, departmentId} (ESR-correct) • {departmentId, age, salary} • {departmentId, salary, age} • {age, departmentId, salary} • {age, salary, departmentId} Same query. Same data. Different results.
1
0
0
Test setup: • 1M documents • age (41 values) • salary (~1M unique values) • departmentIds (array of 3, from 10K total) Query: age = 40 AND departmentId IN (250 ids) ORDER BY salary
1
0
0
MongoDB recommends ordering compound indexes as: 1️⃣ Equality 2️⃣ Sort 3️⃣ Range This usually works — but I wanted to test it with real data, not assumptions.
1
0
1
I benchmarked MongoDB’s ESR (Equality–Sort–Range) index rule on 1M documents — and found cases where following the guideline gives the worst performance. Cardinality, multi-key indexes, and $in queries change everything. 🧵👇
1
0
0
#Govt should make all #MumbaiRain related projects public how the money was invested and how it was utilized. We should have real time dashboards #DigitalIndia this should be the first step.
0
0
0
I think #chatgpt, #Gemini can do better city planning and management in Mumbai than what our government is doing for so many years. Every year the same issue we don't need to patch the old infra but need new infra and accountability. #MumbaiRain
1
0
0
Claim 10000-20000 $HMSTR 10 Millions $HMSTR extra Giveaway STEP 1 : 🩶 & 🔁 + Follow @CatsGiveaways 🔔 STEP 2 : Drop your $TON wallet Must Complete All Task First 1000 user Wallet Address #Hamster_Kombat
627
356
514
35,000 $DOGS ( $72 ) Sending to all wallets 🔥 ( 2.25Billions $DOGS Airdrops Giveaway! Must👇 ) ✅ Follow 🔔 ✅ Like + RT Drop your $TON wallet address 👇
681
404
548
Claim 10000-20000 $HMSTR 5 Millions #hamster extra Giveaway STEP 1 : 🩶 & 🔁 + Follow 🔔 STEP 2 : Drop your $TON wallet Claim here. https://t.co/zGXGCXYbz5 Must Complete All Task First 10000 user Wallet Address #HamsterKombat $NAKA $TAO #hamsterkombatcombo #Airdrops
422
249
401