Hi, ShardingSphere community, 

 

We are using Sharding-Sphere 4.0.RC2 in our project for a long time. Recently, 
we are encountering a serious issue struggling us. When we try to insert 5K 
records one time into one table, it takes about 40 seconds. However, when the 
execution time is about 0.11 second according to MySQL Audit log. 

 

To figure our the root reason, we try to disable ShardingSphere and use native 
JDBC instead, the result is very positive. It is so quick to execute the same 
SQL. It is about 0.2s.

 

Based on above findings, we think ShardingJDBC may cause it happen. 

 

To solve it, we are finding the possible solution. Here is our solution, as not 
all of MySQL tables need to use sharding feature. we have those non-sharding 
tables keep to use the native JDBC, not use ShardingJDBC. To implement it, we 
try to find the way to implement it according to the official document, 
unfortunately, we don??t find the best way.  

 

How to implement our solution? Alternatively, any other solution to resolve it?

 

To help to understand it easily ,here is some information for the reference.

 

--------The format of SQL DML like this------

INSERT INTO tbl_orders (id,f2,f3,....) VALUES (1,xx,xx,...), (2,xx,xx,...), 
(3,xx,xx,...), ...,(5000,xx,xx,...). 

Please note, the table  tbl_orders is a non-sharding table.

 

------ Java --------

Java 1.8

 

----MySQL---

MySQL 5.7

 

--OS -- 

CentOS 7.2







Terry

Reply via email to