/**
* Yielding semantics:
* If the entry that a cursor points at is not deleted during a yield, the cursor will
* point at that entry after a restore.
* An entry inserted during a yield may or may not be returned by an in-progress scan.
* An entry deleted during a yield may or may not be returned by an in-progress scan.
* An entry modified during a yield may or may not be returned by an in-progress scan.
* An entry that is not inserted or deleted during a yield will be returned, and only once.
* If the index returns entries in a given order (Btree), this order will be mantained even
* if the entry corresponding to a saved position is deleted during a yield.
*/
如果游标指向的元素在Yield期间没有被删除,那么在恢复后仍然指向这个位置。在Yield时,插入,删除,或者修改的元素,是否会被游标发现是不确定的。
/**
* An IndexAccessMethod is the interface through which all the mutation, lookup, and
* traversal of index entries is done. The class is designed so that the underlying index
* data structure is opaque to the caller.
*
* IndexAccessMethods for existing indices are obtained through the system catalog.
*
* We assume the caller has whatever locks required. This interface is not thread safe.
*
*/
btree_based_access_method.h[cpp]
if (v == 0 && !getGlobalEnvironment()->getGlobalStorageEngine()->isMmapV1()) {
return Status( ErrorCodes::CannotCreateIndex,
str::stream()
<< "use of v0 indexes is only allowed with the "
<< "mmapv1 storage engine");
}
V1和V0的不同点也集中在数组的处理上,V0版本,过于简单,很多数组结构索引解析出来的结果不完整,主要体现在了NULL的处理。
例如: