Pergunta

I'm in a try to optimize some cassandra queries which I use the row key as the criteria. So my doubt is, considering the process of comparing the row key inside cassandra, what would be the best 'key_validation_class' for it?

Does the UTF8Type have a worse performance than Int32Type? At now, I'm using some concatenated values in order to create my row key as UTF8Type, but i'm kind afraid it be a bad approach.

Thanks in advance.

Foi útil?

Solução

key_validation_class is just a convenient hint to to enforce validation criteria on a key. Think of it as constrain. Cassandra works internally with bytes only. This is unlikely to cause any performance issues.

Size of the "key name" is generally not an issue as long it's within reasonable limits (let's say 64-128 bytes is absolutely normal).

Decision if it's better to use UTF or Int32 is mostly driven by need to partition data and perform range slices.

Cassandra's main strength is lookup by a key - so don't worry about the key name at the beginning. Spend more time designing columns where right design decisions will pay off.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top