激情五月天婷婷,亚洲愉拍一区二区三区,日韩视频一区,a√天堂中文官网8

<ul id="buwfs"><strike id="buwfs"><strong id="buwfs"></strong></strike></ul>
    <output id="buwfs"></output>
  • <dfn id="buwfs"><source id="buwfs"></source></dfn>
      <dfn id="buwfs"><td id="buwfs"></td></dfn>
      <div id="buwfs"><small id="buwfs"></small></div>
      <dfn id="buwfs"><source id="buwfs"></source></dfn>
      1. <dfn id="buwfs"><td id="buwfs"></td></dfn>
        始創(chuàng)于2000年 股票代碼:831685
        咨詢熱線:0371-60135900 注冊(cè)有禮 登錄
        • 掛牌上市企業(yè)
        • 60秒人工響應(yīng)
        • 99.99%連通率
        • 7*24h人工
        • 故障100倍補(bǔ)償
        全部產(chǎn)品
        您的位置: 網(wǎng)站首頁(yè) > 幫助中心>文章內(nèi)容

        InnoDB與Oracle單行存儲(chǔ)長(zhǎng)度對(duì)比

        發(fā)布時(shí)間:  2012/8/10 17:51:03

        眾所周知,MySQL InnoDB存儲(chǔ)引擎與Oracle非常相似,支持事務(wù),row-locking,經(jīng)過實(shí)際測(cè)試,innodb與oracle一個(gè)比較大的差異點(diǎn)為,相同數(shù)據(jù),innodb單行存儲(chǔ)長(zhǎng)度大概是oracle單行存儲(chǔ)長(zhǎng)度的1.8倍。
        測(cè)試的表,常見的各種類型都有,number,varchar2,date

        --首先在Oracle中做測(cè)試 , 在Oracle數(shù)據(jù)庫(kù)中此表單行長(zhǎng)度平均為458字節(jié)
        -
         

        09:49:45 danchen@ test_Oracle>select blocks from dba_extents where segment_name='test_dc' and rownum<2;

            BLOCKS
        ----------
              1280

        1 row selected.

        09:52:55 danchen@ test_Oracle>select /*+ rowid(u)*/  count(*) from test_dc u where rowid>=CHARTOROWID('AAADQdAA6AAADcJAAA') and rowid<=CHARTOROWID('AAADQdAA6AAADwICcQ');

          COUNT(*)
        ----------

             22852

        09:54:55 danchen@ test_Oracle>select 1280*8*1024/22852 bytes from dual;

             BYTES
        ----------
        458.855242

        --在mysql作對(duì)比測(cè)試
        root@test_mysql 09:47:47>select count(*) from test_dc_181;
        +----------+
        | count(*) |
        +----------+
        |   128928 |
        +----------+
        1 row in set (0.08 sec)

        root@test_mysql 09:45:57>show table status like 'test_dc_181'\G;
        *************************** 1. row ***************************
                   Name: test_dc_181
                 Engine: InnoDB
                Version: 10
             Row_format: Compact
                   Rows: 85668   --統(tǒng)計(jì)信息不準(zhǔn)確
         Avg_row_length: 1122
            Data_length: 96141312
        Max_data_length: 0
           Index_length: 0
              Data_free: 0
         Auto_increment: NULL
            Create_time: 2009-05-27 11:23:55
            Update_time: NULL
             Check_time: NULL
              Collation: gbk_chinese_ci
               Checksum: NULL
         Create_options:
                Comment: InnoDB free: 292984832 kB
        1 row in set (0.00 sec)

        ERROR:
        No query specified


        --重新分析一下,發(fā)現(xiàn)執(zhí)行分析操作時(shí)間非?,數(shù)據(jù)也比較準(zhǔn)確,估計(jì)mysql的分析的算法原理為基于抽樣的統(tǒng)計(jì),比如說一個(gè)page里有多少記錄,總的page數(shù)是多少,兩者相乘即可得到行數(shù)。
        root@test_mysql 09:46:01>analyze table test_dc_181;
        +---------------------+---------+----------+----------+
        | Table               | Op      | Msg_type | Msg_text |
        +---------------------+---------+----------+----------+
        | test_mysql.test_dc_181 | analyze | status   | OK       |
        +---------------------+---------+----------+----------+
        1 row in set (0.00 sec)

        root@test_mysql 09:46:46>show table status like 'test_dc_181'\G;
        *************************** 1. row ***************************
                   Name: test_dc_181
                 Engine: InnoDB
                Version: 10
             Row_format: Compact
                   Rows: 115074
         Avg_row_length: 835
            Data_length: 96141312
        Max_data_length: 0
           Index_length: 0
              Data_free: 0
         Auto_increment: NULL
            Create_time: 2009-05-27 11:23:55
            Update_time: NULL
             Check_time: NULL
              Collation: gbk_chinese_ci
               Checksum: NULL
         Create_options:
                Comment: InnoDB free: 292984832 kB
        1 row in set (0.00 sec)

        ERROR:
        No query specified

        --在mysql innodb的表中平均單行長(zhǎng)度為835字節(jié)

        root@test_mysql 09:46:50>select 96141312/115074;
        +-----------------+
        | 96141312/115074 |
        +-----------------+
        |        835.4738 |
        +-----------------+
        1 row in set (0.00 sec)


        --同一行記錄,在Oracle與mysql存儲(chǔ)空間對(duì)比為1.8:1,所以在做容量估計(jì)的時(shí)候要注意。
        root@test_mysql 09:48:14>select 835.4738/458.855242 ;
        +---------------------+
        | 835.4738/458.855242 |
        +---------------------+
        |          1.82077859 |
        +---------------------+
        1 row in set (0.00 sec)


        本文出自:億恩科技【mszdt.com】

        服務(wù)器租用/服務(wù)器托管中國(guó)五強(qiáng)!虛擬主機(jī)域名注冊(cè)頂級(jí)提供商!15年品質(zhì)保障!--億恩科技[ENKJ.COM]

      2. 您可能在找
      3. 億恩北京公司:
      4. 經(jīng)營(yíng)性ICP/ISP證:京B2-20150015
      5. 億恩鄭州公司:
      6. 經(jīng)營(yíng)性ICP/ISP/IDC證:豫B1.B2-20060070
      7. 億恩南昌公司:
      8. 經(jīng)營(yíng)性ICP/ISP證:贛B2-20080012
      9. 服務(wù)器/云主機(jī) 24小時(shí)售后服務(wù)電話:0371-60135900
      10. 虛擬主機(jī)/智能建站 24小時(shí)售后服務(wù)電話:0371-60135900
      11. 專注服務(wù)器托管17年
        掃掃關(guān)注-微信公眾號(hào)
        0371-60135900
        Copyright© 1999-2019 ENKJ All Rights Reserved 億恩科技 版權(quán)所有  地址:鄭州市高新區(qū)翠竹街1號(hào)總部企業(yè)基地億恩大廈  法律顧問:河南亞太人律師事務(wù)所郝建鋒、杜慧月律師   京公網(wǎng)安備41019702002023號(hào)
          0
         
         
         
         

        0371-60135900
        7*24小時(shí)客服服務(wù)熱線