Lenguaje de consulta de Cassandra: obtener la clave máxima

I need to get a maximal key of a column family an cassandra database for further use. How can I get it using cassandra query language or hector API?

preguntado el 10 de marzo de 12 a las 16:03

1 Respuestas

Unless you are using an ordered partitioner, which is usually a bad idea, getting the maximal key in a column family is very expensive. See este article for more details about random versus ordered partitioner.

Generally you want to structure your cassandra data model so that you do gets on a single key, rather than gets on a range of keys. Often you have to denormalize your data to do so.

respondido 10 mar '12, 16:03

I absolutely agree. You can scan all keys and get maximal value within your app. this is very expensive. I suggest t0 maintain list of keys in different structure (Column Family) if you need to look it up quickly. - vladaman

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.