In a bank of approximately 300,000 records, the query below:
SELECT count(usuario) FROM analytics where
datahora.entrada >= '2016-11-18T00:00:00.000Z' and
datahora.entrada <= '2016-11-18T99:99:99.999Z' limit 5000
It takes about 1 min, using n1ql would it be possible to optimize it using indexes? I tried to do as below but it did not work
CREATE INDEX 'ANALYTICS_datahora-entrada' ON 'analytics'(('datahora'.'entrada')) WHERE ('_type' = "analytics") USING GSI