Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 django 模型(mysql 后端)中存储大型位数组的最佳方法是什么?
例如,我如何存储这个对象:
import bitarray bits = bitarray.bitarray('11000101010') #real data is 35k bits long
我应该把它推到 CharField 里吗?
MySQL 有一个值得考虑的 BLOB 字段类型。
或者您可以将其转换为以长度为前缀的十六进制字符串,这将占用不到 9KB:
"11,C54"
或者 ASCII-85,它占用的空间比十六进制少。