Linked Questions
24 questions linked to/from JDBC batch insert performance
3 votes
2 answers
9k views
Java Batch Insert into MySQL very slow [duplicate]
Possible Duplicate: JDBC batch insert performance I have the following method in a class: public void insertShingleSets(Vector<ShingleSet> shingleSets) { String sql = "...
0 votes
0 answers
638 views
JDBC prepared statement, batch insert performance improvement [duplicate]
I have a huge set of data, and i want to insert them on database at once, i used prepared statement with batch insert but it takes around 15 seconds on pstmt.executeBatch(). I'm looking for best ...
2 votes
0 answers
370 views
30 minutes to insert 100k records with JDBC Batch Update while inserting records [duplicate]
I am working on one migration script using Java. I want to migrate data from SQL Server to Mysql. I am using the below code to migrate 1 table but the performance is very slow. It is taking approx 30 ...
454 votes
21 answers
515k views
Multiple Updates in MySQL
I know that you can insert multiple rows at once, is there a way to update multiple rows at once (as in, in one query) in MySQL? Edit: For example I have the following Name id Col1 Col2 Row1 1 ...
39 votes
10 answers
110k views
Why Spring's jdbcTemplate.batchUpdate() so slow?
I'm trying to find the faster way to do batch insert. I tried to insert several batches with jdbcTemplate.update(String sql), where sql was builded by StringBuilder and looks like: INSERT INTO ...
29 votes
2 answers
23k views
What's the difference between cachePrepStmts and useServerPrepStmts in MySQL JDBC Driver
The MySQL JDBC Driver defines these two properties as: useServerPrepStmts - Use server-side prepared statements if the server supports them? cachePrepStmts - Should the driver cache the ...
11 votes
1 answer
14k views
Low JDBC write speed from Spark to MySQL
I need write about 1 million rows from Spark a DataFrame to MySQL but the insert is too slow. How can I improve it? Code below: df = sqlContext.createDataFrame(rdd, schema) df.write.jdbc(url='xx', ...
2 votes
4 answers
15k views
java - Multipile update statements in MySql
so I have a software which basically downloads 1.5K game server address from my MySQL db. It then pings all of them and then upload the information such as online players back to the database. The ...
8 votes
1 answer
5k views
How programatically set rewriteBatchedStatements for mysql jdbc driver?
Here is a way to speed up batch insert performance. Can rewriteBatchedStatements be set programatically, not via url?
14 votes
2 answers
1k views
Spring jdbcTemaplate how to send complete batch size to DB2 server in one shot?
While jdbcTemplate.batchUpdate(...) is running I can see DB row count is increased gradually(by running count(*) in the table), initially 2k then 3k and goes till 10k. 2k and 3k are not exact numbers ...
6 votes
1 answer
5k views
Optimizing oracle jdbc batch inserts
I need to make a large amount of inserts, i.e. double digit millions, into an Oracle-DB using JDBC. To do so I'm using something like the following class, inspired by Efficient way to do batch INSERTS ...
1 vote
1 answer
2k views
jdbc template batch update with snowflake database is very slow
I have a spring boot application that connects to the Snowflake Database and uploads records (approx 50 columns of different data types). I am using JdbcTemplate.batchUpdate(insertSql, values, types) ...
0 votes
1 answer
2k views
Why update takes long time but not insert in spring jdbctemplate batchupdate?
I am trying to do a batch update for 3000 records. It takes around 15 seconds to complete, but insertion happens within 1 second. Had included rewriteBatchedStatements=true also. Do i need to do ...
2 votes
2 answers
905 views
Java- Cannot insert batch of 1000 to table
Let's say I have a program where I am inserting records into MYSQL table in ddatabase in Java. Instead of inserting row by row, I insert by a batch of 1000 records. Using ExecuteBatch method, it ...
0 votes
1 answer
2k views
Increase performance SQL Server JDBC Batch update
I am using preparedstatement batch update/insert to store data into database. But it is taking 3 minutes to persist 1000 entries into SQL Server Database. Am wondering if there is a way to improve the ...