首頁 >資料庫 >mysql教程 >mongodb基础-索引

mongodb基础-索引

WBOY
WBOY原創
2016-06-07 14:50:001039瀏覽

1.索引介绍 mongodb的索引和我们遇到的rdbms的索引含义一样,原理也基本一样首先我们先在一个没有索引的集合上做一个查询,具体的查询计划可以通过explain()函数获取: db . t1 . find ({ username : user101 }). explain () { queryPlanner : { plannerVersion

1.索引介绍

mongodb的索引和我们遇到的rdbms的索引含义一样,原理也基本一样 首先我们先在一个没有索引的集合上做一个查询,具体的查询计划可以通过explain()函数获取:
<code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pun" style="color:rgb(147,161,161)">></span><span class="pln" style="color:rgb(72,72,76)"> db</span><span class="pun" style="color:rgb(147,161,161)">.</span><span class="pln" style="color:rgb(72,72,76)">t1</span><span class="pun" style="color:rgb(147,161,161)">.</span><span class="pln" style="color:rgb(72,72,76)">find</span><span class="pun" style="color:rgb(147,161,161)">({</span><span class="str" style="color:rgb(221,17,68)">"username"</span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="str" style="color:rgb(221,17,68)">"user101"</span><span class="pun" style="color:rgb(147,161,161)">}).</span><span class="pln" style="color:rgb(72,72,76)">explain</span><span class="pun" style="color:rgb(147,161,161)">()</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pun" style="color:rgb(147,161,161)">{</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">	</span><span class="str" style="color:rgb(221,17,68)">"queryPlanner"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">{</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">		</span><span class="str" style="color:rgb(221,17,68)">"plannerVersion"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="lit" style="color:rgb(25,95,145)">1</span><span class="pun" style="color:rgb(147,161,161)">,</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">		</span><span class="str" style="color:rgb(221,17,68)">"namespace"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="str" style="color:rgb(221,17,68)">"suq.t1"</span><span class="pun" style="color:rgb(147,161,161)">,</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">		</span><span class="str" style="color:rgb(221,17,68)">"indexFilterSet"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="kwd" style="color:rgb(30,52,123)">false</span><span class="pun" style="color:rgb(147,161,161)">,</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">		</span><span class="str" style="color:rgb(221,17,68)">"parsedQuery"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">{</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">			</span><span class="str" style="color:rgb(221,17,68)">"username"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">{</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">				</span><span class="str" style="color:rgb(221,17,68)">"$eq"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="str" style="color:rgb(221,17,68)">"user101"</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">			</span><span class="pun" style="color:rgb(147,161,161)">}</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">		</span><span class="pun" style="color:rgb(147,161,161)">},</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">		</span><span class="str" style="color:rgb(221,17,68)">"winningPlan"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">{</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">			</span><span class="str" style="color:rgb(221,17,68)">"stage"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="str" style="color:rgb(221,17,68)">"COLLSCAN"</span><span class="pun" style="color:rgb(147,161,161)">,</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">			</span><span class="str" style="color:rgb(221,17,68)">"filter"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">{</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">				</span><span class="str" style="color:rgb(221,17,68)">"username"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">{</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">					</span><span class="str" style="color:rgb(221,17,68)">"$eq"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="str" style="color:rgb(221,17,68)">"user101"</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">				</span><span class="pun" style="color:rgb(147,161,161)">}</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">			</span><span class="pun" style="color:rgb(147,161,161)">},</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">			</span><span class="str" style="color:rgb(221,17,68)">"direction"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="str" style="color:rgb(221,17,68)">"forward"</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">		</span><span class="pun" style="color:rgb(147,161,161)">},</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">		</span><span class="str" style="color:rgb(221,17,68)">"rejectedPlans"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">[</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">]</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">	</span><span class="pun" style="color:rgb(147,161,161)">},</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">	</span><span class="str" style="color:rgb(221,17,68)">"serverInfo"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">{</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">		</span><span class="str" style="color:rgb(221,17,68)">"host"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="str" style="color:rgb(221,17,68)">"mongodb1"</span><span class="pun" style="color:rgb(147,161,161)">,</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">		</span><span class="str" style="color:rgb(221,17,68)">"port"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="lit" style="color:rgb(25,95,145)">27017</span><span class="pun" style="color:rgb(147,161,161)">,</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">		</span><span class="str" style="color:rgb(221,17,68)">"version"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="str" style="color:rgb(221,17,68)">"3.2.6"</span><span class="pun" style="color:rgb(147,161,161)">,</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">		</span><span class="str" style="color:rgb(221,17,68)">"gitVersion"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="str" style="color:rgb(221,17,68)">"05552b562c7a0b3143a729aaa0838e558dc49b25"</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">	</span><span class="pun" style="color:rgb(147,161,161)">},</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">	</span><span class="str" style="color:rgb(221,17,68)">"ok"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="lit" style="color:rgb(25,95,145)">1</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pun" style="color:rgb(147,161,161)">}</span></code>
如果要看详细的执行计划可以在explain添加executionStats或者allPlansExecution
<code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pun" style="color:rgb(147,161,161)">></span><span class="pln" style="color:rgb(72,72,76)"> db</span><span class="pun" style="color:rgb(147,161,161)">.</span><span class="pln" style="color:rgb(72,72,76)">t1</span><span class="pun" style="color:rgb(147,161,161)">.</span><span class="pln" style="color:rgb(72,72,76)">find</span><span class="pun" style="color:rgb(147,161,161)">({</span><span class="str" style="color:rgb(221,17,68)">"username"</span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="str" style="color:rgb(221,17,68)">"user101"</span><span class="pun" style="color:rgb(147,161,161)">}).</span><span class="pln" style="color:rgb(72,72,76)">explain</span><span class="pun" style="color:rgb(147,161,161)">(</span><span class="str" style="color:rgb(221,17,68)">"<strong><span style="color:#0000ff">allPlansExecution</span></strong>"</span><span class="pun" style="color:rgb(147,161,161)">)</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pun" style="color:rgb(147,161,161)">{</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">	</span><span class="str" style="color:rgb(221,17,68)">"queryPlanner"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">{</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">		</span><span class="str" style="color:rgb(221,17,68)">"plannerVersion"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="lit" style="color:rgb(25,95,145)">1</span><span class="pun" style="color:rgb(147,161,161)">,</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">		</span><span class="str" style="color:rgb(221,17,68)">"namespace"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="str" style="color:rgb(221,17,68)">"suq.t1"</span><span class="pun" style="color:rgb(147,161,161)">,</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">		</span><span class="str" style="color:rgb(221,17,68)">"indexFilterSet"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="kwd" style="color:rgb(30,52,123)">false</span><span class="pun" style="color:rgb(147,161,161)">,</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">		</span><span class="str" style="color:rgb(221,17,68)">"parsedQuery"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">{</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">			</span><span class="str" style="color:rgb(221,17,68)">"username"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">{</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">				</span><span class="str" style="color:rgb(221,17,68)">"$eq"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="str" style="color:rgb(221,17,68)">"user101"</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">			</span><span class="pun" style="color:rgb(147,161,161)">}</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">		</span><span class="pun" style="color:rgb(147,161,161)">},</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">		</span><span class="str" style="color:rgb(221,17,68)">"winningPlan"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">{</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">			</span><span class="str" style="color:rgb(221,17,68)">"stage"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="str" style="color:rgb(221,17,68)">"FETCH"</span><span class="pun" style="color:rgb(147,161,161)">,</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">			</span><span class="str" style="color:rgb(221,17,68)">"inputStage"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">{</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">				</span><span class="str" style="color:rgb(221,17,68)">"stage"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="str" style="color:rgb(221,17,68)">"IXSCAN"</span><span class="pun" style="color:rgb(147,161,161)">,</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">				</span><span class="str" style="color:rgb(221,17,68)">"keyPattern"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">{</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">					</span><span class="str" style="color:rgb(221,17,68)">"username"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="lit" style="color:rgb(25,95,145)">1</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">				</span><span class="pun" style="color:rgb(147,161,161)">},</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">				</span><span class="str" style="color:rgb(221,17,68)">"indexName"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="str" style="color:rgb(221,17,68)">"username_1"</span><span class="pun" style="color:rgb(147,161,161)">,</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">				</span><span class="str" style="color:rgb(221,17,68)">"isMultiKey"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="kwd" style="color:rgb(30,52,123)">false</span><span class="pun" style="color:rgb(147,161,161)">,</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">				</span><span class="str" style="color:rgb(221,17,68)">"isUnique"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="kwd" style="color:rgb(30,52,123)">false</span><span class="pun" style="color:rgb(147,161,161)">,</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">				</span><span class="str" style="color:rgb(221,17,68)">"isSparse"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="kwd" style="color:rgb(30,52,123)">false</span><span class="pun" style="color:rgb(147,161,161)">,</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">				</span><span class="str" style="color:rgb(221,17,68)">"isPartial"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="kwd" style="color:rgb(30,52,123)">false</span><span class="pun" style="color:rgb(147,161,161)">,</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">				</span><span class="str" style="color:rgb(221,17,68)">"indexVersion"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="lit" style="color:rgb(25,95,145)">1</span><span class="pun" style="color:rgb(147,161,161)">,</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">				</span><span class="str" style="color:rgb(221,17,68)">"direction"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="str" style="color:rgb(221,17,68)">"forward"</span><span class="pun" style="color:rgb(147,161,161)">,</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">				</span><span class="str" style="color:rgb(221,17,68)">"indexBounds"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">{</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">					</span><span class="str" style="color:rgb(221,17,68)">"username"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">[</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">						</span><span class="str" style="color:rgb(221,17,68)">"[\"user101\", \"user101\"]"</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">					</span><span class="pun" style="color:rgb(147,161,161)">]</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">				</span><span class="pun" style="color:rgb(147,161,161)">}</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">			</span><span class="pun" style="color:rgb(147,161,161)">}</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">		</span><span class="pun" style="color:rgb(147,161,161)">},</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">		</span><span class="str" style="color:rgb(221,17,68)">"rejectedPlans"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">[</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">]</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">	</span><span class="pun" style="color:rgb(147,161,161)">},</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">	</span><span class="str" style="color:rgb(221,17,68)">"executionStats"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">{</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">		</span><span class="str" style="color:rgb(221,17,68)">"executionSuccess"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="kwd" style="color:rgb(30,52,123)">true</span><span class="pun" style="color:rgb(147,161,161)">,</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">		</span><span class="str" style="color:rgb(221,17,68)">"nReturned"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="lit" style="color:rgb(25,95,145)">1</span><span class="pun" style="color:rgb(147,161,161)">,</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">		</span><span class="str" style="color:rgb(221,17,68)">"executionTimeMillis"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="lit" style="color:rgb(25,95,145)">0</span><span class="pun" style="color:rgb(147,161,161)">,</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">		</span><span class="str" style="color:rgb(221,17,68)">"totalKeysExamined"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="lit" style="color:rgb(25,95,145)">1</span><span class="pun" style="color:rgb(147,161,161)">,</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">		</span><span class="str" style="color:rgb(221,17,68)">"totalDocsExamined"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="lit" style="color:rgb(25,95,145)">1</span><span class="pun" style="color:rgb(147,161,161)">,</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">		</span><span class="str" style="color:rgb(221,17,68)">"executionStages"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">{</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">			</span><span class="str" style="color:rgb(221,17,68)">"stage"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="str" style="color:rgb(221,17,68)">"FETCH"</span><span class="pun" style="color:rgb(147,161,161)">,</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">			</span><span class="str" style="color:rgb(221,17,68)">"nReturned"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="lit" style="color:rgb(25,95,145)">1</span><span class="pun" style="color:rgb(147,161,161)">,</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">			</span><span class="str" style="color:rgb(221,17,68)">"executionTimeMillisEstimate"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="lit" style="color:rgb(25,95,145)">0</span><span class="pun" style="color:rgb(147,161,161)">,</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">			</span><span class="str" style="color:rgb(221,17,68)">"works"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="lit" style="color:rgb(25,95,145)">2</span><span class="pun" style="color:rgb(147,161,161)">,</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">			</span><span class="str" style="color:rgb(221,17,68)">"advanced"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="lit" style="color:rgb(25,95,145)">1</span><span class="pun" style="color:rgb(147,161,161)">,</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">			</span><span class="str" style="color:rgb(221,17,68)">"needTime"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="lit" style="color:rgb(25,95,145)">0</span><span class="pun" style="color:rgb(147,161,161)">,</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">			</span><span class="str" style="color:rgb(221,17,68)">"needYield"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="lit" style="color:rgb(25,95,145)">0</span><span class="pun" style="color:rgb(147,161,161)">,</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">			</span><span class="str" style="color:rgb(221,17,68)">"saveState"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="lit" style="color:rgb(25,95,145)">0</span><span class="pun" style="color:rgb(147,161,161)">,</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">			</span><span class="str" style="color:rgb(221,17,68)">"restoreState"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="lit" style="color:rgb(25,95,145)">0</span><span class="pun" style="color:rgb(147,161,161)">,</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">			</span><span class="str" style="color:rgb(221,17,68)">"isEOF"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="lit" style="color:rgb(25,95,145)">1</span><span class="pun" style="color:rgb(147,161,161)">,</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">			</span><span class="str" style="color:rgb(221,17,68)">"invalidates"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="lit" style="color:rgb(25,95,145)">0</span><span class="pun" style="color:rgb(147,161,161)">,</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">			</span><span class="str" style="color:rgb(221,17,68)">"docsExamined"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="lit" style="color:rgb(25,95,145)">1</span><span class="pun" style="color:rgb(147,161,161)">,</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">			</span><span class="str" style="color:rgb(221,17,68)">"alreadyHasObj"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="lit" style="color:rgb(25,95,145)">0</span><span class="pun" style="color:rgb(147,161,161)">,</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">			</span><span class="str" style="color:rgb(221,17,68)">"inputStage"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">{</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">				</span><span class="str" style="color:rgb(221,17,68)">"stage"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="str" style="color:rgb(221,17,68)">"IXSCAN"</span><span class="pun" style="color:rgb(147,161,161)">,</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">				</span><span class="str" style="color:rgb(221,17,68)">"nReturned"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="lit" style="color:rgb(25,95,145)">1</span><span class="pun" style="color:rgb(147,161,161)">,</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">				</span><span class="str" style="color:rgb(221,17,68)">"executionTimeMillisEstimate"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="lit" style="color:rgb(25,95,145)">0</span><span class="pun" style="color:rgb(147,161,161)">,</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">				</span><span class="str" style="color:rgb(221,17,68)">"works"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="lit" style="color:rgb(25,95,145)">2</span><span class="pun" style="color:rgb(147,161,161)">,</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">				</span><span class="str" style="color:rgb(221,17,68)">"advanced"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="lit" style="color:rgb(25,95,145)">1</span><span class="pun" style="color:rgb(147,161,161)">,</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">				</span><span class="str" style="color:rgb(221,17,68)">"needTime"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="lit" style="color:rgb(25,95,145)">0</span><span class="pun" style="color:rgb(147,161,161)">,</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">				</span><span class="str" style="color:rgb(221,17,68)">"needYield"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="lit" style="color:rgb(25,95,145)">0</span><span class="pun" style="color:rgb(147,161,161)">,</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">				</span><span class="str" style="color:rgb(221,17,68)">"saveState"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="lit" style="color:rgb(25,95,145)">0</span><span class="pun" style="color:rgb(147,161,161)">,</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">				</span><span class="str" style="color:rgb(221,17,68)">"restoreState"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="lit" style="color:rgb(25,95,145)">0</span><span class="pun" style="color:rgb(147,161,161)">,</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">				</span><span class="str" style="color:rgb(221,17,68)">"isEOF"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="lit" style="color:rgb(25,95,145)">1</span><span class="pun" style="color:rgb(147,161,161)">,</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">				</span><span class="str" style="color:rgb(221,17,68)">"invalidates"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="lit" style="color:rgb(25,95,145)">0</span><span class="pun" style="color:rgb(147,161,161)">,</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">				</span><span class="str" style="color:rgb(221,17,68)">"keyPattern"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">{</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">					</span><span class="str" style="color:rgb(221,17,68)">"username"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="lit" style="color:rgb(25,95,145)">1</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">				</span><span class="pun" style="color:rgb(147,161,161)">},</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">				</span><span class="str" style="color:rgb(221,17,68)">"indexName"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="str" style="color:rgb(221,17,68)">"username_1"</span><span class="pun" style="color:rgb(147,161,161)">,</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">				</span><span class="str" style="color:rgb(221,17,68)">"isMultiKey"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="kwd" style="color:rgb(30,52,123)">false</span><span class="pun" style="color:rgb(147,161,161)">,</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">				</span><span class="str" style="color:rgb(221,17,68)">"isUnique"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="kwd" style="color:rgb(30,52,123)">false</span><span class="pun" style="color:rgb(147,161,161)">,</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">				</span><span class="str" style="color:rgb(221,17,68)">"isSparse"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="kwd" style="color:rgb(30,52,123)">false</span><span class="pun" style="color:rgb(147,161,161)">,</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">				</span><span class="str" style="color:rgb(221,17,68)">"isPartial"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="kwd" style="color:rgb(30,52,123)">false</span><span class="pun" style="color:rgb(147,161,161)">,</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">				</span><span class="str" style="color:rgb(221,17,68)">"indexVersion"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="lit" style="color:rgb(25,95,145)">1</span><span class="pun" style="color:rgb(147,161,161)">,</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">				</span><span class="str" style="color:rgb(221,17,68)">"direction"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="str" style="color:rgb(221,17,68)">"forward"</span><span class="pun" style="color:rgb(147,161,161)">,</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">				</span><span class="str" style="color:rgb(221,17,68)">"indexBounds"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">{</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">					</span><span class="str" style="color:rgb(221,17,68)">"username"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">[</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">						</span><span class="str" style="color:rgb(221,17,68)">"[\"user101\", \"user101\"]"</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">					</span><span class="pun" style="color:rgb(147,161,161)">]</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">				</span><span class="pun" style="color:rgb(147,161,161)">},</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">				</span><span class="str" style="color:rgb(221,17,68)">"keysExamined"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="lit" style="color:rgb(25,95,145)">1</span><span class="pun" style="color:rgb(147,161,161)">,</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">				</span><span class="str" style="color:rgb(221,17,68)">"dupsTested"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="lit" style="color:rgb(25,95,145)">0</span><span class="pun" style="color:rgb(147,161,161)">,</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">				</span><span class="str" style="color:rgb(221,17,68)">"dupsDropped"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="lit" style="color:rgb(25,95,145)">0</span><span class="pun" style="color:rgb(147,161,161)">,</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">				</span><span class="str" style="color:rgb(221,17,68)">"seenInvalidated"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="lit" style="color:rgb(25,95,145)">0</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">			</span><span class="pun" style="color:rgb(147,161,161)">}</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">		</span><span class="pun" style="color:rgb(147,161,161)">},</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">		</span><span class="str" style="color:rgb(221,17,68)">"allPlansExecution"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">[</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">]</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">	</span><span class="pun" style="color:rgb(147,161,161)">},</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">	</span><span class="str" style="color:rgb(221,17,68)">"serverInfo"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">{</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">		</span><span class="str" style="color:rgb(221,17,68)">"host"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="str" style="color:rgb(221,17,68)">"mongodb1"</span><span class="pun" style="color:rgb(147,161,161)">,</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">		</span><span class="str" style="color:rgb(221,17,68)">"port"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="lit" style="color:rgb(25,95,145)">27017</span><span class="pun" style="color:rgb(147,161,161)">,</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">		</span><span class="str" style="color:rgb(221,17,68)">"version"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="str" style="color:rgb(221,17,68)">"3.2.6"</span><span class="pun" style="color:rgb(147,161,161)">,</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">		</span><span class="str" style="color:rgb(221,17,68)">"gitVersion"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="str" style="color:rgb(221,17,68)">"05552b562c7a0b3143a729aaa0838e558dc49b25"</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">	</span><span class="pun" style="color:rgb(147,161,161)">},</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">	</span><span class="str" style="color:rgb(221,17,68)">"ok"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="lit" style="color:rgb(25,95,145)">1</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pun" style="color:rgb(147,161,161)">}</span></code>

这里的执行计划是collscan表示集合扫描,我们给文件username创建一个索引,使用db.collectionname.ensureIndex({"colname":[1/-1]})来创建   --新版本中使用createIndex来替换ensureIndex 其中1表示列的排序是从小大到排序,-1表示从大到小排序.
<code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pun" style="color:rgb(147,161,161)">></span><span class="pln" style="color:rgb(72,72,76)"> db</span><span class="pun" style="color:rgb(147,161,161)">.</span><span class="pln" style="color:rgb(72,72,76)">t1</span><span class="pun" style="color:rgb(147,161,161)">.</span><span class="pln" style="color:rgb(72,72,76)">ensureIndex</span><span class="pun" style="color:rgb(147,161,161)">({</span><span class="str" style="color:rgb(221,17,68)">"username"</span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="lit" style="color:rgb(25,95,145)">1</span><span class="pun" style="color:rgb(147,161,161)">})</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pun" style="color:rgb(147,161,161)">{</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">	</span><span class="str" style="color:rgb(221,17,68)">"createdCollectionAutomatically"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="kwd" style="color:rgb(30,52,123)">false</span><span class="pun" style="color:rgb(147,161,161)">,</span></code><code class="language-js" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:rgb(72,72,76)">	</span><span class="str" style="color:rgb(221,17,68)">"numIndexesBefore"</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="pun" style="color:rgb(147,161,161)">:</span><span class="pln" style="color:rgb(72,72,76)"> </span><span class="lit" style="color:rgb(25,95,145)">1</span><span class="pun" style="color:rgb(147,161,161)">,</span></code><code class="lang"></code>
陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn