国产xxxx99真实实拍_久久不雅视频_高清韩国a级特黄毛片_嗯老师别我我受不了了小说

資訊專欄INFORMATION COLUMN

mysql的速度測試

HitenDev / 1024人閱讀

摘要:小草

  

小草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
- 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

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

文章版權歸作者所有,未經允許請勿轉載,若此文章存在違規行為,您可以聯系管理員刪除。

轉載請注明本文地址:http://specialneedsforspecialkids.com/yun/20843.html

相關文章

  • Mongodb 與 MySQL對比

    摘要:通過計算機特征值時間進程與隨機數來確保生成的是唯一的。整體上來看,的速率波動比的嚴重,方差變化較大。的缺陷事務關系支持薄弱。一方面在方便開發者的同時,另一方面對運維人員卻提出了相當多的要求。 在數據庫存放的數據中,有一種特殊的鍵值叫做主鍵,它用于惟一地標識表中的某一條記錄。也就是說,一個表不能有多個主鍵,并且主鍵不能為空值。無論是MongoDB還是MySQL,都存在著主鍵的定義。對于M...

    PingCAP 評論0 收藏0
  • 一文教您如何通過 Docker 快速搭建各種測試環境(Mysql, Redis, Elasticse

    摘要:本文主要說說如何配置阿里云的鏡像加速器。通過修改配置文件來使用加速器執行下面命令驗證一下速度以下載為例,看下速度下載配置了加速器過后,速度終于飚起來了。二快速安裝搭建環境本節中,我們將學習如何通過快速安裝與搭建環境。 歡迎關注個人微信公眾號: 小哈學Java, 優質文章第一時間推送喲!! 個人網站: www.exception.site 小哈今天給大家分享的主題是,如何通過 Docker ...

    FleyX 評論0 收藏0

發表評論

0條評論

HitenDev

|高級講師

TA的文章

閱讀更多
最新活動
閱讀需要支付1元查看
<