我是靠谱客的博主 安静小兔子,这篇文章主要介绍mysql速度_mysql的速度测试,现在分享给大家,希望可以做个参考。

The artile is about a php module for mysql

It likes codeigniter,but has some other feature.

And then, I test It`s speed.

0x01.System Environment

- system

MAC os

Software OS X 10.9.4 (13E28)

Processor 2.4 GHz Intel Core i5

Memory 8 GB 1600 MHz DDR3

250GB SSD

- environment

xampp 1.8.3

Apache/2.4.9

PHP Version 5.5.11

mysqlnd 5.0.11-dev - 20120503 - (mysql is empty)

0x02.Test Insert

Code is here

$jue = new JueQuery();

for($i=0; $i<100; $i++){

$insert_data = array(

'email'=>'xiaocao.grasses@gmail.com',

'username'=>'http://homeway.me/',

"password"=>md5( rand().time() ),

);

$insert_test = $jue->insert_where('user', $insert_data );

}

First test result

blog%2fphp%20_module_mysqlinsert_test_2014-09-19-1.gif

Second test result

blog%2fphp%20_module_mysqlinsert_test_2014-09-19-2.gif

Third test result

blog%2fphp%20_module_mysqlinsert_test_2014-09-19-3.gif

And then mysql is like this:

blog%2fphp%20_module_mysqlinsert_test_2014-09-19-4.gif

0x03.Select a data does not exist in 30000 pieces data

Code is here

for($i=0; $i<100; $i++){

$single = true;

$where = array(

'username'=>'http://homeway.me/',

'password'=>'6f27e19bbdd4f290038149344fcc5ffd',

);

$select_test = $jue->select('id|username|email')->order_by('id', 'ASC')->get_where('user', $where,$single);

$jue->debug('Select Test', $select_test);

}

Test result is here:

blog%2fphp%20_module_mysql_select_test_2014-09-19-1.gif

0x04.Select a data exist in 30000 pieces data

Test result is here:

blog%2fphp%20_module_mysql_select_test_2014-09-19-2.gif

Ox05.Select a data exist in 30000 pieces data using normal function without class

Code is here

for ($i=1; $i < 100 ; $i++) {

$select = "SELECT * FROM `user` WHERE `password` = 'd29a75d265e91f0de0342443eb2731b5'";

$select_result = mysql_query($select);

}

Test result is here:

blog%2fphp%20_module_mysql_select_test_2014-09-19-3.gif

From result we know that, run class and function, only using 10 seconds in 10000 fetch, so class is efficiention

0x06.Update 30000 in 30000 pieces of data

Code is here:

for($i=0; $i<100; $i++){

$where = array(

'id'=>$i,

);

$set = array(

'username'=>'http://homeway.me/',

'email'=>'xiaocao.grasses@gmail.com',

);

$update_test = $jue->update_where('user', $where, $set);

}

Test result is here:

blog%2fphp%20_module_mysql_update_test_2014-09-19-1.gif

-By xiaocao

2014-09-19 19:16:45

最后

以上就是安静小兔子最近收集整理的关于mysql速度_mysql的速度测试的全部内容,更多相关mysql速度_mysql内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(107)

评论列表共有 0 条评论

立即
投稿
返回
顶部