DESCRIPTION

Add _verify_keys for faster verification

In my quick tests the _verify_keys function is about 10x faster
than the  _verify_docs_doc_name. It doesn't need to create a
MapReduce View.

This commit also changes _get_key to always return ASCII values.
This makes the comparison with the inserted keys easier (else
we need to convert the doc_names to unicode) and we have ASCII
compatible keys anyway.

Change-Id: Ia07254e4fba5385d64e19fa12ae984d07d7fde5f


COMMENTS

author: Ayla Reynolds
date: 2012-02-02 22:26:08.132000000

Patch Set 1:

If you like this optimization, we can use the _verify_keys function in other places as well.

-------------------------------------
author: Reid Stokes
date: 2012-02-02 23:13:32.592000000

Patch Set 1: Looks good to me, approved

This is awesome

-------------------------------------
author: Reid Stokes
date: 2012-02-03 18:39:50.518000000

Patch Set 1: I would prefer that you didn't submit this

Fails. 

def _verify_keys()

should keep trying for querying the view index the way _verify_doc_names does..

-------------------------------------
author: Ayla Reynolds
date: 2012-02-03 18:44:58.196000000

Patch Set 1:

@karan

It's hard to tell from the diff. The _verify_keys() is called in the _load_docs function. Hence it makes sense to verify if the data was really inserted.

With _verify_docs_doc_name you verify that when you build a MapReduce View, all documents end in this view. If the view has a bug, the verification fails. _verify_keys() doesn't depend on a view, but just on the actual data in the database (AFIAK).

-------------------------------------
author: Reid Stokes
date: 2012-02-03 18:46:55.204000000

Patch Set 1: Verified; Looks good to me, approved

Oh I understand.... Sorry for the confusion... 

Seems to be a bug in View then with _all_docs.. :)

-------------------------------------
