I am trying to benchmarking task for some queries in RethinkDB. I really did not get good answer of a question Why RethinkDB's count()
operation is so slow?
I have a query with 2GB of data:
r.db("2GB").table("table").between(40, r.maxval, {index:"price"})
The query is executed in 5 milliseconds But once I would like count the number items like
r.db("2GB").table("table").between(40, r.maxval, {index:"price"}).count()
It took more than 6 seconds Every query that uses count operation is very slow. I have seen many issues in github but could not get exact reason.
Update:
it's not just between()
but all other like filter
....the count()
is horribly slow