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/02 12:13:28 UTC

[GitHub] [incubator-shardingsphere] pengqiang323 opened a new issue #3851: 批量插入1000条数据,耗时10S,请问有什么办法优化?

pengqiang323 opened a new issue #3851: 批量插入1000条数据,耗时10S,请问有什么办法优化?
URL: https://github.com/apache/incubator-shardingsphere/issues/3851
 
 
   批量插入1000条数据,耗时10S,请问有什么办法优化?
   
   sharding-jdbc :4.0.0-RC1
   mysql-connector-java : 5.1.46
   
   以下是我代码,
   
   ```
   
   @Bean
       public DataSource dataSourceInit() throws SQLException {
   
           DruidDataSource druidDataSource = druidDataSourceInit();
   
           // 配置分片规则
           ShardingRuleConfiguration shardingRuleConfig = new ShardingRuleConfiguration();
           shardingRuleConfig.setDefaultDataSourceName("master");
           // 添加分表策略
           shardingRuleConfig.getTableRuleConfigs().add(this.getEtctsAdMpTableRuleConfig(druidDataSource));
           // 添加分表策略
           shardingRuleConfig.getTableRuleConfigs().add(this.getEtctsAdEpTableRuleConfig(druidDataSource));
   
   
           // 配置其余信息
           Properties properties = new Properties();
   //        properties.setProperty("executor.size", "20");
           properties.setProperty("sql.show", "true");
   
           Map<String, DataSource> dataSourceMap = new HashMap<>();
           dataSourceMap.put(ShardingTableConstants.MASTER_SLAVE_RULE_NAME,druidDataSource);
           return ShardingDataSourceFactory.createDataSource(dataSourceMap, shardingRuleConfig, properties);
   //        return druidDataSource;
       }
   ```

----------------------------------------------------------------
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

[GitHub] [incubator-shardingsphere] terrymanu closed issue #3851: 批量插入1000条数据,耗时10S,请问有什么办法优化?

Posted by GitBox <gi...@apache.org>.
terrymanu closed issue #3851: 批量插入1000条数据,耗时10S,请问有什么办法优化?
URL: https://github.com/apache/incubator-shardingsphere/issues/3851
 
 
   

----------------------------------------------------------------
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

[GitHub] [incubator-shardingsphere] terrymanu commented on issue #3851: 批量插入1000条数据,耗时10S,请问有什么办法优化?

Posted by GitBox <gi...@apache.org>.
terrymanu commented on issue #3851: 批量插入1000条数据,耗时10S,请问有什么办法优化?
URL: https://github.com/apache/incubator-shardingsphere/issues/3851#issuecomment-570266226
 
 
   **For English only**, other languages will not accept.

----------------------------------------------------------------
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