如何使用密码对查询结果进行分页? [英] How to paginate query results with cypher?
问题描述
是否可以对密码查询进行分页.例如,一个产品列表,但我不想显示/检索/缓存所有结果,因为我可以有很多结果.
Is it possible to have cypher query paginated. For instance, a list of products, but I don't want to display/retrieve/cache all the results as i can have a lot of results.
我正在寻找类似于 SQL 中的偏移量/限制的东西.
I'm looking for something similar to the offset / limit in SQL.
cypher skip + limit + orderby 是一个不错的选择吗?http://docs.neo4j.org/chunked/stable/query-skip.html
Is cypher skip + limit + orderby a good option ? http://docs.neo4j.org/chunked/stable/query-skip.html
推荐答案
SKIP
和 LIMIT
结合起来确实是要走的路.使用 ORDER BY
不可避免地会使密码扫描与您的查询相关的每个节点.使用 WHERE
子句也是如此.不过性能应该不会那么差.
SKIP
and LIMIT
combined is indeed the way to go. Using ORDER BY
inevitably makes cypher scan every node that is relevant to your query. Same thing for using a WHERE
clause. Performance should not be that bad though.
这篇关于如何使用密码对查询结果进行分页?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!