使用 rid 和 limit 获取记录
Fetching record using rid and limit
我在 class 中有 500 000 条记录。
我想获取 2000 条记录并发送以供处理。
查询:
SELECT FROM class WHERE @rid > "#-1:-1" ORDER BY @rid ASC LIMIT 2000
fetched more than 50000 records: to speed up the execution, create an
index or change the query to use an existent index [OProfiler]
如何避免此警告?
我也尝试过使用 between 运算符。我收到了同样的警告。
我已经尝试 SELECT FROM class WHERE @rid > "#-1:-1" ORDER BY @rid ASC LIMIT 2000
使用 OrientDb 2.0.13,但没有任何警告。例如,如果我尝试限制 51000,我会得到你的例外。
Query 'SELECT FROM Persona WHERE @rid > "#-1:-1" ORDER BY @rid ASC
LIMIT 51000' fetched more than 50000 records: to speed up the
execution, create an index or change the query to use an existent
index [OProfiler].
如果您使用 limit = 2000,则不应出现此异常。
查看文档 http://orientdb.com/docs/2.1/Pagination.html#use-the-rid-limit 并尝试使用“#-1:-1”和 #-1:-1,查询在这两种情况下都适用。
我在 class 中有 500 000 条记录。
我想获取 2000 条记录并发送以供处理。
查询:
SELECT FROM class WHERE @rid > "#-1:-1" ORDER BY @rid ASC LIMIT 2000
fetched more than 50000 records: to speed up the execution, create an index or change the query to use an existent index [OProfiler]
如何避免此警告?
我也尝试过使用 between 运算符。我收到了同样的警告。
我已经尝试 SELECT FROM class WHERE @rid > "#-1:-1" ORDER BY @rid ASC LIMIT 2000
使用 OrientDb 2.0.13,但没有任何警告。例如,如果我尝试限制 51000,我会得到你的例外。
Query 'SELECT FROM Persona WHERE @rid > "#-1:-1" ORDER BY @rid ASC LIMIT 51000' fetched more than 50000 records: to speed up the execution, create an index or change the query to use an existent index [OProfiler].
如果您使用 limit = 2000,则不应出现此异常。
查看文档 http://orientdb.com/docs/2.1/Pagination.html#use-the-rid-limit 并尝试使用“#-1:-1”和 #-1:-1,查询在这两种情况下都适用。