找到网上一大神方法(头晕了, 准备明天测试吧):
http://stackoverflow.com/questions/4777070/hamming-distance-on-binary-strings-in-sql
这种是32位, 分成4分, 保存在bigint类型里,
The only fast way to get decent performance is to split the content of the BINARY column in multiple BIGINT columns, each containing an 8-byte substring of the original data.
但迷惑的是, bigint远不止保存2的8次方那么大, 为什么只保存8位. 如果是非得是8位, 那我岂不是要建8个bigint类型来储存64个bit. 求大大们解惑.
http://stackoverflow.com/questions/4777070/hamming-distance-on-binary-strings-in-sql
这种是32位, 分成4分, 保存在bigint类型里,
The only fast way to get decent performance is to split the content of the BINARY column in multiple BIGINT columns, each containing an 8-byte substring of the original data.
但迷惑的是, bigint远不止保存2的8次方那么大, 为什么只保存8位. 如果是非得是8位, 那我岂不是要建8个bigint类型来储存64个bit. 求大大们解惑.
解决方案 »
- mysql中如何根据某一字段排序后再每10个元素中按照另一字段排序?
- mysql存储过程问题
- Mysql 字符串和数字转换问题,我新手请指教,谢谢了
- mysql删除不了的记录
- SQl executon error # 1064 是什么
- 语句排序的问题,谢谢了
- MySql下如何用条件查询?
- mysql集群
- 关于MySQL自动安装配置的问题
- 多个线程load infile插入表,同时select count(1)此表,导致统计一直处于sending data长达好几千秒,如何解决
- 为什么我输入net stop MYSQL 会没有反应呢?
- ERROR 1045 (28000): Access denied for user 'root'@'localhost'[灌水免进 有分了可以补给]
CREATE TABLE `pictures` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`filename` varchar(255) DEFAULT NULL
`time_added` varchar(255) DEFAULT NULL,
`time_update` varchar(255) DEFAULT NULL,
`hash` bit(64) DEFAULT NULL,
`hash2` bit(64) DEFAULT NULL COMMENT 'hash 180',
PRIMARY KEY (`id`),
KEY `hash` (`hash`)
) ENGINE=memory DEFAULT CHARSET=utf8;
大大们能否帮我解惑:
bigint远不止保存2的8次方那么大, 为什么只保存8位. 如果是非得是8位, 那我岂不是要建8个bigint类型来储存64个bit. 求大大们解惑.