mysql的速度测试
来源:互联网 发布:光大金阳光软件 编辑:程序博客网 时间:2024/05/16 18:44
小草blog : http://homeway.me/
The artile is about a php module for mysql
It likes codeigniter,but has some other feature.
And then, I test It`s speed.
Fork me here: https://github.com/grasses/JueQuery
0x01.System Environment
- systemMAC osSoftware OS X 10.9.4 (13E28)Processor 2.4 GHz Intel Core i5Memory 8 GB 1600 MHz DDR3250GB SSD- environmentxampp 1.8.3Apache/2.4.9PHP Version 5.5.11mysqlnd 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
Second test result
Third test result
And then mysql is like this:
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:
0x04.Select a data exist in 30000 pieces data
Test result is here:
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:
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:
Please indicate the source:http://homeway.me/2014/09/19/PHP-Module-Mysql/
-By xiaocao
2014-09-19 19:16:45
0 0
- mysql的速度测试
- MySQL测试SQL执行的速度测试
- MySQL prepare statement速度的测试思考
- 对mysql数据库批量插入数据的速度测试
- 测试jdbc几种操作mysql数据方法的速度
- mysql连接localhost还是127.0.0.1的速度测试
- mysql索引提升查询速度的实例测试
- Access的速度测试
- kryo的速度测试
- memcpy的速度测试
- 测试CSDN的blog速度
- 测试家里宽带的速度
- 关于数据库速度的测试
- 扫描DataTable的速度测试
- 测试站点的链接速度
- 测试硬盘读写的速度
- APP的启动速度测试
- 测试服务器的运算速度
- my simple vim configure
- zigbee学习参考(1~42 )
- 黑马程序员——Java基础知识
- 微观SOA:服务设计原则及 其实践方式(下篇)
- oracle日期相加减
- mysql的速度测试
- navicat导入sql语句文件失败原因-----datetime
- ScrollView嵌套ListView
- Groovy语言 Grails框架入门
- log4j 详解
- 实现鼠标放到一个div上显示出另一个隐藏的div
- Groovy&Grails
- Nginx 反向代理 websocket
- Nginx反向代理、防盗图