Let’s .explain() MongoDB Performance | Twitch Live Coding

preview_player
Показать описание
Query performance can either be a constant headache or the unsung hero of any application. A well-tuned database will save you time, resources, and money - not to mention avoiding emergency escalations. Technical Services Engineer and "Query Doctor" Chris Harris and Developer Advocate Karen Huaulmé will demonstrate how to discover and optimize slow running queries. We will then teach you how to use the .explain() method and decipher explain plans to gain insight into your database operations and pick just the right indexes for your workloads.

Time Stamps:
0:00 Introductions and how Karen tricked Chris into being the chump for this "Stump the Chump" session
5:48 Preview of Chris' MongoDB .Live talk
7:31 Agenda
9:32 Quick Atlas tier overview
11:00 Proper indexing example - M10 vs M30 comparison and the "Query Targeting" graph
17:39 Things to consider when encountering poor performance
19:36 Tools in Atlas that will help with resolving performance issues
19:36 Real time performance panel
21:01 Pro tip regarding metric timing and the real time performance panel
22:22 Query Profiler
23:09 Performance Advisor
25:22 Why is an operation slow? Consider hardware for analytical workloads
27:56 The life-changing improvements of tuning queries: 99+% improvements from building indexes
30:19 What is an explain plan? Let's turn an inefficient collection scan into an efficient index scan
33:30 Using indexes to satisfy a sort request
36:46 The "Scan and Order" Atlas graph
37:53 The three Atlas charts that you should look at related to query efficiency and workload
39:04 Compound indexes: ESR guidance and why key ordering is important
41:21 The general structure of explain output, winningPlan and rejectedPlans sections
46:27 Question about wildcard indexes
52:04 Interpreting an explain plan for an aggregation
54:59 gowthamraj100 catches Chris being lazy - What does explain(1) mean?
1:01:24 High level information about querying sharded clusters
1:07:56 Summarizing the effect of the "ESR Rule"
1:11:25 gowthamraj100 asks about MongoDB's plan cache (don't forget about .pretty())
1:14:10 Is there such a thing as too many indexes? $indexStats is helpful for determining index usage
1:18:06 sergiocasao has a few additional questions regarding index usage and next steps. The Atlas UI itself allows you to perform many tasks related to indexing
1:24:08 The team wraps up with a special guest appearance!
Комментарии
Автор

Hi, This video is really giving deep understanding about MongoDb performance. I have one question for you. My application one page is having lots of filter which hits on single collection. I have approx 10 filters option for user. Do I need to really create indexes on all 10 fields? If yes, does it really good for Insert/Update execution after creating index?

yatinpatel
Автор

Fantastic video! Extremely informative :)

felipelpr
Автор

I never get any suggestion from performance advisor although I keep hitting 100% disk consumptions.

ishanmahajan
Автор

when ever i run the performance advisor, i get the : An unexpected error occurred. ive not once got any further on atlas. any ideas why? and when is the next live session Q&A ?

markemerson