insert batch & execute performance
Hi,
I have
- a table about 100MB size
- and try addBatch inserts around 1MB each time
- "?rewriteBatchedStatements = true" is to login added
- @@global.max_allowed_packet = 256000000
- @@global.key_buffer_size = 256000000;
- Code in Java:
conn.setAutoCommit(false);
String query = "insert into " + TABLE + " (id, partInfo) values (?, ?)";
PreparedStatement pstmt = conn.prepareStatement(query);
for(..)
{
pstmt.setInt(ID, jdosym.getId());
pstmt.setBytes(PART, jdosym.getPart());
pstmt.addBatch();
if (i % 1000 == 0) pstmt.executeBatch();
}
pstmt.executeBatch();
conn.commit();
conn.setAutoCommit(true);
pstmt.close();
The Problem is, the execute batch is very very slow!? What can be the reason?
Thanks in advamce,
GlobeTrotter
Subject
Written By
Posted
insert batch & execute performance
February 27, 2020 02:44AM
February 27, 2020 09:28AM
February 27, 2020 11:31AM
February 27, 2020 11:40AM
February 27, 2020 11:46AM
February 27, 2020 12:01PM
February 27, 2020 08:32PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.