MySQL壓測中遇到的一些問題

來源:互聯網
上載者:User

標籤:

批量insert

http://blog.csdn.net/xiaoxian8023/article/details/20155429

 

Mysql jdbc 批處理資料,需要給jdbc串連加上rewriteBatchedStatements=true。預設jdbc是不會開啟批處理。

  例如:jdbc:mysql://10.250.4.98:3306/dbname rewriteBatchedStatements=true

  Java UpdateBatchSample:

  官網forums

  39,260053,263456#msg-263456

  MySQL itself has no real "batch" API for prepared statements. If you add the configuration property "rewriteBatchedStatements=true" to your JDBC connection string for Connector/J, the driver will rewrite batches of prepared INSERTs into multi-value form, and all other forms of statements into multi-statements, which does give a large performance gain (7-10x).

  注意:

  jdbc driver 版本需要 5.1.8 及以上

MySQL壓測中遇到的一些問題

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.