Hi,
so, are we even sure this is related to the usage of views?
Anyway…
There’s only 1 query per 24 hours, so then it should be 0,0000116 times per second 
Each node has 4 vCPUs and 14 ECUs (Amazon EC2).
Here is the view we’re using:
function(doc, meta) {
var Base64 = {
// private property
_keyStr : “ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=”,
// public method for decoding
decode : function (input) {
var output = "";
var chr1, chr2, chr3;
var enc1, enc2, enc3, enc4;
var i = 0;
input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
while (i < input.length) {
enc1 = this._keyStr.indexOf(input.charAt(i++));
enc2 = this._keyStr.indexOf(input.charAt(i++));
enc3 = this._keyStr.indexOf(input.charAt(i++));
enc4 = this._keyStr.indexOf(input.charAt(i++));
chr1 = (enc1 << 2) | (enc2 >> 4);
chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
chr3 = ((enc3 & 3) << 6) | enc4;
output = output + String.fromCharCode(chr1);
if (enc3 != 64) {
output = output + String.fromCharCode(chr2);
}
if (enc4 != 64) {
output = output + String.fromCharCode(chr3);
}
}
return output;
},
};
(function(globalScope) {
globalScope.msgpack = {
unpack: msgpackunpack, // msgpack.unpack(data:BinaryString/ByteArray):Mix
// [1][String to mix] msgpack.unpack("…") -> {}
// [2][ByteArray to mix] msgpack.unpack([…]) -> {}
};
var _bin2num = {}, // BinaryStringToNumber { "\00": 0, ... "\ff": 255 }
_num2bin = {}, // NumberToBinaryString { 0: "\00", ... 255: "\ff" }
_num2b64 = ("ABCDEFGHIJKLMNOPQRSTUVWXYZ" +
"abcdefghijklmnopqrstuvwxyz0123456789+/").split(""),
_buf = [], // decode buffer
_idx = 0, // decode buffer[index]
_error = 0, // msgpack.pack() error code. 1 = CYCLIC_REFERENCE_ERROR
_isArray = Array.isArray || (function(mix) {
return Object.prototype.toString.call(mix) === "[object Array]";
}),
_toString = String.fromCharCode, // CharCode/ByteArray to String
_MAX_DEPTH = 512;
// msgpack.unpack
function msgpackunpack(data) {
_buf = typeof data === "string" ? toByteArray(data) : data;
_idx = -1;
return decode(); // mix or undefined
}
// inner - decoder
function decode() { // @return Mix:
var size, i, iz, c, num = 0,
sign, exp, frac, ary, hash,
buf = _buf, type = buf[++_idx];
if (type >= 0xe0) { // Negative FixNum (111x xxxx) (-32 ~ -1)
return type - 0x100;
}
if (type < 0xc0) {
if (type < 0x80) { // Positive FixNum (0xxx xxxx) (0 ~ 127)
return type;
}
if (type < 0x90) { // FixMap (1000 xxxx)
num = type - 0x80;
type = 0x80;
} else if (type < 0xa0) { // FixArray (1001 xxxx)
num = type - 0x90;
type = 0x90;
} else { // if (type < 0xc0) { // FixRaw (101x xxxx)
num = type - 0xa0;
type = 0xa0;
}
}
switch (type) {
case 0xc0: return null;
case 0xc2: return false;
case 0xc3: return true;
case 0xca: // float
num = buf[++_idx] * 0x1000000 + (buf[++_idx] << 16) +
(buf[++_idx] << 8) + buf[++_idx];
sign = num & 0x80000000; // 1bit
exp = (num >> 23) & 0xff; // 8bits
frac = num & 0x7fffff; // 23bits
if (!num || num === 0x80000000) { // 0.0 or -0.0
return 0;
}
if (exp === 0xff) { // NaN or Infinity
return frac ? NaN : Infinity;
}
return (sign ? -1 : 1) *
(frac | 0x800000) * Math.pow(2, exp - 127 - 23); // 127: bias
case 0xcb: // double
num = buf[++_idx] * 0x1000000 + (buf[++_idx] << 16) +
(buf[++_idx] << 8) + buf[++_idx];
sign = num & 0x80000000; // 1bit
exp = (num >> 20) & 0x7ff; // 11bits
frac = num & 0xfffff; // 52bits - 32bits (high word)
if (!num || num === 0x80000000) { // 0.0 or -0.0
_idx += 4;
return 0;
}
if (exp === 0x7ff) { // NaN or Infinity
_idx += 4;
return frac ? NaN : Infinity;
}
num = buf[++_idx] * 0x1000000 + (buf[++_idx] << 16) +
(buf[++_idx] << 8) + buf[++_idx];
return (sign ? -1 : 1) *
((frac | 0x100000) * Math.pow(2, exp - 1023 - 20) // 1023: bias
+ num * Math.pow(2, exp - 1023 - 52));
// 0xcf: uint64, 0xce: uint32, 0xcd: uint16
case 0xcf: num = buf[++_idx] * 0x1000000 + (buf[++_idx] << 16) +
(buf[++_idx] << 8) + buf[++_idx];
return num * 0x100000000 +
buf[++_idx] * 0x1000000 + (buf[++_idx] << 16) +
(buf[++_idx] << 8) + buf[++_idx];
case 0xce: num += buf[++_idx] * 0x1000000 + (buf[++_idx] << 16);
case 0xcd: num += buf[++_idx] << 8;
case 0xcc: return num + buf[++_idx];
// 0xd3: int64, 0xd2: int32, 0xd1: int16, 0xd0: int8
case 0xd3: num = buf[++_idx];
if (num & 0x80) { // sign -> avoid overflow
return ((num ^ 0xff) * 0x100000000000000 +
(buf[++_idx] ^ 0xff) * 0x1000000000000 +
(buf[++_idx] ^ 0xff) * 0x10000000000 +
(buf[++_idx] ^ 0xff) * 0x100000000 +
(buf[++_idx] ^ 0xff) * 0x1000000 +
(buf[++_idx] ^ 0xff) * 0x10000 +
(buf[++_idx] ^ 0xff) * 0x100 +
(buf[++_idx] ^ 0xff) + 1) * -1;
}
return num * 0x100000000000000 +
buf[++_idx] * 0x1000000000000 +
buf[++_idx] * 0x10000000000 +
buf[++_idx] * 0x100000000 +
buf[++_idx] * 0x1000000 +
buf[++_idx] * 0x10000 +
buf[++_idx] * 0x100 +
buf[++_idx];
case 0xd2: num = buf[++_idx] * 0x1000000 + (buf[++_idx] << 16) +
(buf[++_idx] << 8) + buf[++_idx];
return num < 0x80000000 ? num : num - 0x100000000; // 0x80000000 * 2
case 0xd1: num = (buf[++_idx] << 8) + buf[++_idx];
return num < 0x8000 ? num : num - 0x10000; // 0x8000 * 2
case 0xd0: num = buf[++_idx];
return num < 0x80 ? num : num - 0x100; // 0x80 * 2
// 0xdb: raw32, 0xda: raw16, 0xa0: raw ( string )
case 0xdb: num += buf[++_idx] * 0x1000000 + (buf[++_idx] << 16);
case 0xda: num += (buf[++_idx] << 8) + buf[++_idx];
case 0xa0: // utf8.decode
for (ary = [], i = _idx, iz = i + num; i < iz; ) {
c = buf[++i]; // lead byte
ary.push(c < 0x80 ? c : // ASCII(0x00 ~ 0x7f)
c < 0xe0 ? ((c & 0x1f) << 6 | (buf[++i] & 0x3f)) :
((c & 0x0f) << 12 | (buf[++i] & 0x3f) << 6
| (buf[++i] & 0x3f)));
}
_idx = i;
return ary.length < 10240 ? _toString.apply(null, ary)
: byteArrayToByteString(ary);
// 0xdf: map32, 0xde: map16, 0x80: map
case 0xdf: num += buf[++_idx] * 0x1000000 + (buf[++_idx] << 16);
case 0xde: num += (buf[++_idx] << 8) + buf[++_idx];
case 0x80: hash = {};
while (num--) {
// make key/value pair
size = buf[++_idx] - 0xa0;
for (ary = [], i = _idx, iz = i + size; i < iz; ) {
c = buf[++i]; // lead byte
ary.push(c < 0x80 ? c : // ASCII(0x00 ~ 0x7f)
c < 0xe0 ? ((c & 0x1f) << 6 | (buf[++i] & 0x3f)) :
((c & 0x0f) << 12 | (buf[++i] & 0x3f) << 6
| (buf[++i] & 0x3f)));
}
_idx = i;
hash[_toString.apply(null, ary)] = decode();
}
return hash;
// 0xdd: array32, 0xdc: array16, 0x90: array
case 0xdd: num += buf[++_idx] * 0x1000000 + (buf[++_idx] << 16);
case 0xdc: num += (buf[++_idx] << 8) + buf[++_idx];
case 0x90: ary = [];
while (num--) {
ary.push(decode());
}
return ary;
}
return;
}
// inner - byteArray To ByteString
function byteArrayToByteString(byteArray) {
try {
return _toString.apply(this, byteArray); // toString
} catch(err) {
; // avoid "Maximum call stack size exceeded"
}
var rv = [], i = 0, iz = byteArray.length, num2bin = _num2bin;
for (; i < iz; ++i) {
rv[i] = num2bin[byteArray[i]];
}
return rv.join("");
}
// inner - BinaryString To ByteArray
function toByteArray(data) {
var rv = [], bin2num = _bin2num, remain,
ary = data.split(""),
i = -1, iz;
iz = ary.length;
remain = iz % 8;
while (remain--) {
++i;
rv[i] = bin2num[ary[i]];
}
remain = iz >> 3;
while (remain--) {
rv.push(bin2num[ary[++i]], bin2num[ary[++i]],
bin2num[ary[++i]], bin2num[ary[++i]],
bin2num[ary[++i]], bin2num[ary[++i]],
bin2num[ary[++i]], bin2num[ary[++i]]);
}
return rv;
}
// --- init ---
(function() {
var i = 0, v;
for (; i < 0x100; ++i) {
v = _toString(i);
_bin2num[v] = i; // "\00" -> 0x00
_num2bin[i] = v; // 0 -> "\00"
}
for (i = 0x80; i < 0x100; ++i) { // [Webkit][Gecko]
_bin2num[_toString(0xf700 + i)] = i; // "\f780" -> 0x80
}
})();
})(this);
var decoded = Base64.decode(doc);
var unpacked = this.msgpack.unpack(decoded);
if(unpacked && typeof(unpacked) === ‘object’ ) {
if(unpacked.hasOwnProperty(‘creator’)) { // is a game
emit(unpacked.updated_at, null);
}
}
}