4 ms·
> If an index is missing for you query pattern, wouldn't you create an index in MySQL/postgres? No. I’d consider adding an index. An index is not free, it come
by Xylakant 6y ago
> If an index is missing for you query pattern, wouldn't you create an index in MySQL/postgres?
No. I’d consider adding an index. An index is not free, it comes at a cost and that cost may well be higher than the costs of not having that index. For example, if a reporting query that runs once every few hours is lacking an index, the cost of updating that index on every write (and the disk space/memory used) may well exceed its benefits.
- lmm 6y agoSecondary indicies can be a lot cheaper in a non-ACID database, where you can acknowledge a write when it is durably committed but index updates may not have completed.
- squeaky-clean 6y agoExactly this. If you connect to your database and run a couple un-indexed queries to explore your data, any query which takes over 100ms will appear for the next 30 days in the "Performance Advisor" tab and it will offer you indexes to create targeted at that query. Just based on a query you did manually one time. Just to note, this is referring to the features for a hosted databased on cloud.mongodb.com, and not something built into MongoDB the database.
- neeleshs 6y agoI prefer this being shown in the slow queries over not showing it at all , from my experience from people running bad queries manually on production MySQL instances and starting a domino effect. I guess to each their own.
- neeleshs 6y agoAgreed, but a notification about a potential performance issue is not forcing anyone to add an index.