问题描述
我是Cassandra的新手。
Cassandra是否遵循任何指定的排序算法,例如气泡排序
,二进制排序
等?如果不是,它将如何按命令排序?
I am a newbie in Cassandra. Does Cassandra follow any specified sorting algorithm like bubble sort
, binary sort
, etc.? If not, How does it sort in order by command?
推荐答案
不是,或者至少不是。在Cassandra中,您将围绕用例构建数据模型。因此,如果要检索排序的数据,则必须将其存储为排序的。如果您希望以不同的方式对相同的数据进行排序,那么您将存储相同的数据多次以不同的方式进行排序。关于Cassandra的工作原理,还有很多要阅读的内容,我认为Cassandra的每个用户都应该这样做。
It doesn't, or at least it shouldn't. In Cassandra you build your data model around your use cases. So if you want to retrieve sorted data you have to store it sorted. If you want the same data sorted in different ways, you store the same data multiple times sorted differently. There is a lot more to read about how Cassandra works, and I think every user of Cassandra should.
与您的问题相关的链接:
Links related to your question:
- https://docs.datastax.com/en/cql/3.3/cql/cql_using/useSimplePrimaryKeyConcept.html
- https://docs.datastax.com/en/cql/3.3/cql/cql_using/useCompoundPrimaryKeyConcept.html
- https://docs.datastax.com/en/cql/3.3/cql/cql_reference/cqlCreateIndex.html
Cassandra入门:
Getting started with Cassandra:
- (前两门课程是必须这样做。您需要注册,但100%免费)
- https://academy.datastax.com/courses (the first two courses is a must do. You need to register but they 100% free)
这篇关于cassandra中的排序方式如何?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!