Skip to content

Best practices when using Appender API #277

Answered by taniabogatsch
charlespnh asked this question in Q&A
Discussion options

You must be logged in to vote

I haven't used the appender in production, but I've worked with others asking the same questions. So, my answer might not work perfectly for your use case, but it could be seen as an indication.

  1. Each Appender should have its own connection. You limit parallelism if you create them on the same connection. Within a connection, DuckDB does not parallelize between append operations. So you'll end up appending to the (different) tables sequentially.
  2. The Appender is supposed to be short-lived. I.e., you get a connection from the pool, create the appender, append your data, close the appender, and then release the connection back into the pool.
    2.1. Creating connections is very lightweight in d…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@charlespnh
Comment options

Answer selected by charlespnh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #258 on September 20, 2024 08:45.