Make JDBC write parallelism configurable#16280
Conversation
|
On top of the #16238 |
112df4a to
bb789cd
Compare
plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/JdbcClient.java
Outdated
Show resolved
Hide resolved
plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/DefaultJdbcMetadata.java
Outdated
Show resolved
Hide resolved
bb789cd to
1791466
Compare
|
Rebased and addressed review. |
plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/JdbcWriteConfig.java
Outdated
Show resolved
Hide resolved
|
Note that maybe default should be |
|
@hashhar I'd prefer a sane default, rather than previous behavior. |
22bdf8d to
587d00c
Compare
plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/JdbcWriteConfig.java
Outdated
Show resolved
Hide resolved
plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/BaseJdbcClient.java
Outdated
Show resolved
Hide resolved
587d00c to
9669ffe
Compare
| public class JdbcWriteConfig | ||
| { | ||
| public static final int MAX_ALLOWED_WRITE_BATCH_SIZE = 10_000_000; | ||
| static final int DEFAULT_WRITE_PARALELLISM = 8; |
There was a problem hiding this comment.
by default QueryManagerConfig defines maxWriterTasksCount = 100 so this is a drastic reduction of writers. Is it by intention?
I see, that it's only for jdbc, so it's probably acceptable and 8 is even better than 100.
Should it be documented?
@jhlodin
There was a problem hiding this comment.
100 means unbounded. for jdbc the higher number of writers, the bigger number of connections opened/acquired/held per write which can result in high lock contention on the database side.
|
Does this need a release note? @wendigo |
|
I think yes... and also docs.. |
| getQueryRunner()::execute, | ||
| "write_parallelism", | ||
| "(a varchar(128), b bigint)")) { | ||
| assertUpdate(session, "INSERT INTO " + table.getName() + " (a, b) SELECT clerk, orderkey FROM tpch.sf100.orders LIMIT " + numberOfRows, numberOfRows, plan -> { |
Added an option query.max-writer-nodes-count to QueryManagerConfig and
a session option that limits number of tasks that take part in writing
nodes.
Description
Additional context and related issues
Release notes
( ) This is not user-visible or docs only and no release notes are required.
( ) Release notes are required, please propose a release note for me.
( ) Release notes are required, with the following suggested text: