mysqldump file import sharding-proxy insert speed slowly
Sharding-proxy version: 4.0.0-RC3
-
Problems encountered:
It took 24 hours to import 10 million records into sharding-proxy. -
Sharding-proxy Config:
start.sh -Xmx8g -Xms8g -Xmn4g,server.yaml use default parm
Do you use PreparedStatement and ParameterMarker?
@terrymanu : I didn't used PreparedStatement and ParameterMarker. What are PreparedStatement and ParameterMarker? database0?serverTimezone=UTC&useSSL=false&characterEncoding=utf8
use sql insert into pku_influencing_factor VALUES (0,'test','test',123.00) normal only 1 record
@terrymanu Do you know why insert is so slow?
Because if you don't use PreparedStatement, it will parse SQL for every call which are very slow. ShardingSphere will cache parse result if using PreparedStatement.
Please search PreparedStatement from google to get more information.
@terrymanu There is not much change ,I have used param:serverTimezone=UTC&useSSL=false&characterEncoding=utf8&useServerPrepStmts=true&cachePrepStmts=true
The test is faster to import directly into backend mysql database;
Terry means you can use ‘insert into pku_influencing_factor VALUES (?,?,?,?)’ with PreparedStatement and put the parameters for every record. @lklkxcxc
@kimmking Can you give me a specific example? thank you!It isnot that how use parm useServerPrepStmts=true&cachePrepStmts=true?
@terrymanu I found add prarm rewriteBatchedStatements=true can to improve speed but still not very fast
You can google or baidu PreparedStatement to find its usage.
You can google or baidu PreparedStatement to find its usage.
@kimmking PreparedStatement can be use in sql scripts?