You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2020/01/03 06:45:37 UTC

[GitHub] [incubator-shardingsphere] xfyang1989 commented on issue #3853: It takes 10s to insert 1000 pieces of data in batch. How can I optimize it?

xfyang1989 commented on issue #3853: It takes 10s to insert 1000 pieces of data in batch. How can I optimize it?
URL: https://github.com/apache/incubator-shardingsphere/issues/3853#issuecomment-570480720
 
 
   > Thank you for your reply.
   > 
   > It takes 10 seconds to insert 1000 records using shardingjdbc ,And I use the bulk insert statement of mybatis。
   > 
   > The sharding route is correct, But it took too long to insert。
   > 
   > ```
   >  <insert id="insertList">
   >         INSERT INTO t_etcts_ad_mp ( id,trade_type,org_id, pay_fee, fee, discount_fee, media_type, obu_id, card_id, trans_time,
   >         vehicle_id,
   >         vehicle_type, service_type, description, pass_id,status,created_time,ad_version,au_version,sum_version,dr_version,dz_version,dz_payment_date,dz_payment_num)
   > 
   >         VALUES
   >         <foreach collection="list" item="item" index="index" separator=",">
   >             ( #{item.id},#{item.tradeType},#{item.orgId}, #{item.payFee}, #{item.fee}, #{item.discountFee}, #{item.mediaType},
   >             #{item.obuId},
   >             #{item.cardId}, #{item.transTime}, #{item.vehicleId}, #{item.vehicleType}, #{item.serviceType},
   >             #{item.description}, #{item.passId}, #{item.status}, #{item.createdTime},#{item.adVersion},  #{item.auVersion},
   >             #{item.sumVersion}, #{item.drVersion}, #{item.dzVersion}, #{item.dzPaymentDate}, #{item.dzPaymentNum})
   > 
   >         </foreach>
   > 
   >     </insert>
   > ```
   
   I also encounter this problem. It's a problem when using batch insert. The number of your inserts, which are parsed every time, is very time-consuming. I hope to help optimize the parsing engine
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services