简体   繁体   English

对于Cassandra中的特定位长度,我们需要使用哪种类型的主键?

[英]What type of primary key we need to use for specific length of bits in Cassandra?

I want to know in which situations which type of primary key I need to use. 我想知道在哪种情况下需要使用哪种类型的主键。
Situations: 情况:
1. If I need 64 bit key than is bigint is the best for it? 1.如果我需要64位密钥,那么bigint最好吗? If I will chose text type will performance will be the same if I will put keys which is not more then 64 bits? 如果我选择文本类型,如果我输入不超过64位的密钥,性能是否会相同?
2. If I need a primary key which is more then 64 bits and less then 128 bits (let say 80 bits) then which data type I have to use for primary key? 2.如果我需要一个大于64位且小于128位(比如说80位)的主键,那么我必须为主键使用哪种数据类型?

For variable bits length you could use a blob field type. 对于可变位长度,可以使用blob字段类型。 Or maybe throw away the small optimization you are looking for and stick with two bigint type primary key and move ahead with your project... 或者也许放弃您正在寻找的小型优化并坚持使用两个bigint类型的主键并继续进行您的项目...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 主键的类型/值应为无限制 - What should be the type/value of a primary key that should be unlimited 用于散列密码字段的数据类型和长度是多少? - What data type to use for hashed password field and what length? MySQL主键字段类型 - MySQL Primary Key Field Type 可变长度数据使用哪种数据类型(以提高性能)? - What data type to use for variable length data (for performance)? 我们可以用于消息 function 的按钮类型是什么? - What is the button type we can use for message function? 如何使用类型注释来指示未知长度的Tuple类型参数是返回的映射的关键? - How do I use type annotations to indicate an unknown-length Tuple type parameter is the key of the returned Mapping? 有没有办法将类型声明中特定键的值用作同一声明中另一个键的类型(在 Typescript 中)? - Is there a way to use the value from a specific key in a type declaration as the type of another key in that same declaration (in Typescript)? 主键的SQL数据类型 - SQL Server? - Sql Data Type for Primary Key - SQL Server? [sql-Server]用什么数据类型来设置密码盐和哈希值以及长度是多少? - [Sql-Server]what data type to use for password salt and hash values and what length? 我们应该使用什么原始或什么类型来表示java中的电话号码? - what primitive or what type should we use to represent a telephone number in java?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM