I am inserting 1 million records in an empty oracle table. In order to improve insert performance I have tried following optimizations:
However, I am not able to see any improvement in the insert performance. I am not able to figure out why.
Note that I am using org.springframework.jdbc.core.JdbcTemplate#batchUpdate
for inserting records and I am inserting records in the batch of 20000.
Earliar Oracle has published Document regarding Performance tuning for JDBC: Oracle JDBC Memory Management
Here are the few tips
Optimise the batch size ,depending on your oracle configuration.
Cache the preparedstatement and use the same statement for all batches (Need cleanup) or Use statement pooling (Oracle JDBC Driver Supports it. See the above document).
Oracle has few Performance extensions defined: Performance Extensions . Instead of addBatch
use sendBatch
for improving batch performance.See Example 23-1 in above document. 1
[1] Oracle style batching using setExecuteBatch
and sendBatch
was desupported in 12.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.