高性能的MySQL(5)创建高性能的索引一哈希索引
来源:互联网 发布:数据交换接口规范.doc 编辑:程序博客网 时间:2024/05/16 01:28
1
2
3
4
5
CREATE
TABLE
`testhash` (
`fname`
varchar
(50)
NOT
NULL
,
`lname`
varchar
(50)
NOT
NULL
,
KEY
`fname` (`fname`) USING HASH
) ENGINE=MEMORY
DEFAULT
CHARSET=utf8 |
值
2323
指向第1行指针2458
指向第4行指针
7437
指向第2行指针
8784
指向第3行指针
1
select
*
from
testhash
where
fname=
'Peter'
;
1
select
*
from
url
where
url=
"http://www.baidu.com"
;
1
select * from url where url_crc=crc32(
"http://www.baidu.com"
) and url=
"http://www.baidu.com"
;
1
2
3
4
5
6
CREATE
TABLE
`pseudohash` (
`id`
int
(10) unsigned
NOT
NULL
AUTO_INCREMENT,
`url`
varchar
(255)
NOT
NULL
,
`url_crc`
int
(10) unsigned
NOT
NULL
DEFAULT
'0'
,
PRIMARY
KEY
(`id`)
) ENGINE=InnoDB
DEFAULT
CHARSET=utf8;
1
2
3
4
5
6
//插入
delimiter $$
create
trigger
pseudohash_crc_ins before
insert
on
pseudohash
for
each row
begin
set
NEW.url_crc=crc32(NEW.url);
end
;$$
//更新
create
trigger
pseudohash_crc_upd before
update
on
pseudohash
for
each row
begin
set
NEW.url_crc=crc32(NEW.url);
end
;$$
delimiter ;
- 高性能的MySQL(5)创建高性能的索引一哈希索引
- 高性能的MySQL(5)创建高性能的索引一B-Tree索引
- MySQL高性能 创建高性能的索引
- 高性能Mysql——创建高性能的索引
- [高性能MySQL]-创建高性能的索引
- 高性能Mysql 3(创建高性能的索引)
- [ 笔记 ] mysql创建高性能的索引
- MySQL创建高性能的索引
- 如何创建高性能的MySQL索引
- mysql创建高性能的索引
- 创建高性能的索引
- 创建高性能的索引
- 高性能Mysql-5创建高性能的索引(上)
- mysql 高性能的索引
- 高性能的MySQL索引
- 高性能的MySQL(5)索引策略一聚簇索引
- 高性能的MySQL(5)索引策略一聚簇索引
- (三)创建高性能的索引
- linux之块设备驱动
- linux块设备之nand flash
- 高性能的MySQL(5)创建高性能的索引一B-Tree索引
- 把JDesktopPane里面设置层
- 关于C++中const修饰的一些备忘.....【2013.10.23】
- 高性能的MySQL(5)创建高性能的索引一哈希索引
- 发送email的方法使用swing
- flex基础篇一,基于httpservice通信+java后台的项目创建
- 高性能的MySQL(5)索引策略
- android Gallery与imageView 滑动冲突问题解决方法
- cocos2dx教程之传感器事件
- 使用打开网页_swing_browse
- C++ string 用法详解
- 将非模态对话框显示为模态对话框