在Django中需要向数据库中插入多条数据(list).使用如下方法,每次save()的时候都会访问一次数据库.导致性能问题: for i in resultlist: p = Account(name=i) p.save() 在django1.4以后加入了新的特性.使用django.db.models.query.QuerySet.bulk_create()批量创建对象,减少SQL查询次数.改进如下: querysetlist=[] for i in resultlist: querysetl…
Spring Boot项目使用了spring-boot-devtools工具且在Eclipse中Debug调试会自动跳转到这个方法: public static void exitCurrentThread() { throw new SilentEitException(); } 解决方法: Eclipse->[Window]->[Preferences]->[Java]->[Debug]:去掉[Suspend execution on uncaught exceptions]前…
hbase一般用于大数据的批量分析,所以在很多情况下需要将大量数据从外部导入到hbase中,hbase提供了一种导入数据的方式,主要用于批量导入大量数据,即importtsv工具,用法如下: Usage: importtsv -Dimporttsv.columns=a,b,c <tablename> <inputdir> Imports the given input directory of TSV data into the specified table. The col…