Hunter的大杂烩 技术学习笔记

November 13, 2012

sql-bench-insert-test ssd vs harddisk

Filed under: 技术话题 — hunter @ 5:42 pm

harddisk

Generating random keys
Creating tables
Inserting 10000 rows in order
Inserting 10000 rows in reverse order
Inserting 10000 rows in random order
Time for insert (30000): 1111 wallclock secs ( 1.51 usr  0.46 sys +  0.00 cusr  0.00 csys =  1.97 CPU)
Testing update of keys with functions
Time for update_of_key (5000):  110 wallclock secs ( 0.17 usr  0.06 sys +  0.00 cusr  0.00 csys =  0.23 CPU)
Time for update_of_key_big (480): 41 wallclock secs ( 0.03 usr  0.01 sys +  0.00 cusr  0.00 csys =  0.04 CPU)

Testing update with key
Time for update_with_key (30000):  773 wallclock secs ( 1.18 usr  0.41 sys +  0.00 cusr  0.00 csys =  1.59 CPU)
Time for update_with_key_prefix (10000):  240 wallclock secs ( 0.79 usr  0.16 sys +  0.00 cusr  0.00 csys =  0.95 CPU)

Generating random keys
Creating tables
Inserting 10000 rows in order
Inserting 10000 rows in reverse order
Inserting 10000 rows in random order
Time for insert (30000): 785 wallclock secs ( 1.47 usr  0.43 sys +  0.00 cusr  0.00 csys =  1.90 CPU)
Testing update of keys with functions
Time for update_of_key (5000): 123 wallclock secs ( 0.21 usr 0.07 sys + 0.00 cusr 0.00 csys = 0.28 CPU)
Time for update_of_key_big (480): 19 wallclock secs ( 0.03 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.03 CPU)

Testing update with key

Time for update_with_key (30000): 763 wallclock secs ( 1.26 usr 0.40 sys + 0.00 cusr 0.00 csys = 1.66 CPU)
Time for update_with_key_prefix (10000): 258 wallclock secs ( 0.95 usr 0.14 sys + 0.00 cusr 0.00 csys = 1.09 CPU)

结论,在写入方面相差不是很明显,插入大概节省1/3时间,update方面轻微胜出

No Comments

No comments yet.

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

Powered by WordPress