See N1QL implementation at
http://review.couchbase.org/#/c/100135/
MB-30473
*DB gerrit review
Gerrit change