rethinkdb: “RqlRuntimeError: Array over size limit” even when using limit()

匆匆过客 提交于 2019-12-01 19:34:23
Joe Doliner

The reason you get an error here is that the orderBy gets evaluated before the limit so it orders the entire table in memory which is over the array limit. The way to fix this is by using and index. Try doing the following:

table.indexCreate("date")
table.indexWait()
table.orderBy({index: r.desc("date")}).limit(50)

That should be equivalent to what you have there but uses an index so it doesn't require loading the entire table into memory.

This code is decision problem.

ro:= r.RunOpts{ArrayLimit: 500000}
r.DB("wrk").Table("log").Run(sessionArray[0],ro)

// This code for Python r.db('awesome_db').table("main").run(sesion, r.runOpts{arrayLimit: 500000})

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!