Vote count:
0
I started to use Cassandra two days ago, moving from relationnal databases so my idea of Cassandra might be wrong and if I say something stupid, please teach me!
So here is my problem: What I wanted to do is create a simple table with 3 entries (Country | Name | Last_Update). My primary key is (Country | Name), but I want to sort everything automatically by Last_Update.
The only way I saw was to perform that way: CREATE TABLE Client (Country text, Name text, Last_Update date, PRIMARY KEY((Country,Name),date) WITH CLUSTERING ORDER BY (Last_Update DESC);
For obvious reasons that's not a thing I want, I don't want the Last_Update in the primary key at all, moreover I can't edit it if it's in the primary key and it doesn't ensure the unicity of the couple (Country,Name) ...
Is there a way to do what I want properly using Cassandra? I'm starting to despair a bit ... :(
Cassandra: ORDER BY not a primary key
Aucun commentaire:
Enregistrer un commentaire