cassandra分页:驱动程序和CQL之间的区别 [英] cassandra pagination: the difference between driver and CQL
问题描述
我正在此处中阅读驱动程序分页.但是CQL在WHERE子句中也支持LIMIT.想知道这两者之间有什么区别
I am reading driver pagination in here. but CQL also support LIMIT in WHERE clause. Wonder what is the difference between these two
推荐答案
分页是您一次处理多少结果.
Pagination is how much you of your result you work with at a time.
WHERE
和LIMIT
与您的结果有关.
假设您请求X≤的所有行; 100.这可能是指一百万个不同的行.如果客户端或服务器立即请求所有这些请求,则会造成很大的资源压力.为了避免这种情况,驱动程序一次只能请求几行.这样一来,客户端和服务器就可以处理一系列的项目,而不必为前面的所有项目分配空间.
Imagine you request all rows where X < 100. This may refer to 1 million different rows. If the client or the server requested all of this at once it would cause a lot of resource pressure. To avoid this the driver is capable of asking for just a few rows at a time. This allows the client and the server to work with a stream of items rather than allocating space for everything up front.
这篇关于cassandra分页:驱动程序和CQL之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!