Skip to content

Improve PostgreSQL INSERT performance#12417

Merged
hashhar merged 3 commits intotrinodb:masterfrom
wendigo:serafin/improve-pg-insert-performance
May 17, 2022
Merged

Improve PostgreSQL INSERT performance#12417
hashhar merged 3 commits intotrinodb:masterfrom
wendigo:serafin/improve-pg-insert-performance

Conversation

@wendigo
Copy link
Contributor

@wendigo wendigo commented May 16, 2022

Extracted from #12400

@cla-bot cla-bot bot added the cla-signed label May 16, 2022
@wendigo wendigo requested review from Praveen2112 and kokosing May 16, 2022 13:55
@wendigo
Copy link
Contributor Author

wendigo commented May 16, 2022

reWriteBatchedInserts = bool Enable optimization to rewrite and collapse compatible INSERT statements that are batched. If enabled, pgjdbc rewrites batch of insert into ... values(?, ?) into insert into ... values(?, ?), (?, ?), ... That reduces per-statement overhead. The drawback is if one of the statements fail, the whole batch fails. The default value is false. The option is available since 9.4.1208

https://jdbc.postgresql.org/documentation/94/connect.html

@wendigo wendigo force-pushed the serafin/improve-pg-insert-performance branch from 1019ca1 to abb99cb Compare May 16, 2022 16:00
{
return new DriverConnectionFactory(new Driver(), config, credentialProvider);
Properties connectionProperties = new Properties();
connectionProperties.put(REWRITE_BATCHED_INSERTS.name(), TRUE.toString());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can use "true" here

@hashhar hashhar merged commit 2d532b2 into trinodb:master May 17, 2022
@github-actions github-actions bot added this to the 382 milestone May 17, 2022
@hashhar hashhar mentioned this pull request May 17, 2022
@wendigo wendigo deleted the serafin/improve-pg-insert-performance branch May 18, 2022 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

6 participants