测试场景:
硬件:2台HP G6(Host1和Host2)
操作系统:Suse10 SP2
软件:Host1上有一个Management Node,一个Data Node和一个Mysql Server;Host2上有一个Data Node。不考虑分脑情况。
数据量:表中原有数据2,000,000,操作的数据有900,000
测试结论:
1. 基于主键的操作是最快的操作;
2. =操作在Hash索引上比在Ordered索引操作上性能要好;(select除外,很奇怪)
3. select操作对索引类型基本不敏感;
4. 基于Integer类型建立的索引性能要好于基于Varchar类型建立的索引
测试结果:
Insert(202s)
01:17:54
01:21:16
Result: 4455records/s
selectOnPrimaryKey(143s)
00:11:55
00:14:18
Result: 6293records/s
selectOnIntIndex(156s)
00:17:06
00:19:42
Result: 5769records/s
selectOnIntUniqueKey(167s)
00:20:46
00:23:33
Result: 5389records/s
selectOnVarCharIndex(172s)
00:23:57
00:26:49
Result: 5233records/s
selectOnVarCharUniqueKey(175s)
00:28:05
00:31:00
Result: 5142records/s
updateOnPrimaryKey(155s)
00:33:06
00:35:41
Result: 5806records/s
updateOnIntIndex(228s)
00:35:58
00:39:46
Result: 3947records/s
updateOnIntUniqueKey(163s)
00:40:12
00:42:55
Result: 5521records/s
updateOnVarCharIndex(240s)
01:02:45
01:06:45
Result: 3750records/s
updateOnVarCharUniqueKey(171s)
01:08:09
01:11:00
Result: 5263records/s
deleteOnPrimaryKey(140s)
01:14:32
01:16:52
Result: 6428records/s
deleteOnIntIndex(210s)
01:21:50
01:25:20
Result: 4286records/s
deleteOnIntUniqueKey(146s)
01:34:38
01:37:04
Result: 6164records/s
deleteOnVarCharIndex(215s)
01:43:59
01:47:34
Result: 4186records/s
deleteOnVarCharUniqueKey(152s)
01:55:21
01:57:53
Result: 5921records/s