You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "ouyangwulin (Jira)" <ji...@apache.org> on 2024/03/21 07:11:00 UTC

[jira] [Commented] (FLINK-34901) Improve the performance of the update Postgres database

    [ https://issues.apache.org/jira/browse/FLINK-34901?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17829404#comment-17829404 ] 

ouyangwulin commented on FLINK-34901:
-------------------------------------

Please assign this ticket for me。

> Improve the performance of the update Postgres database
> -------------------------------------------------------
>
>                 Key: FLINK-34901
>                 URL: https://issues.apache.org/jira/browse/FLINK-34901
>             Project: Flink
>          Issue Type: Improvement
>          Components: Connectors / JDBC
>            Reporter: ouyangwulin
>            Priority: Minor
>              Labels: pull-request-available
>
> When writing Postgres data using flinker-connector-jdbc, using upsert mode, we need only update no uniqueColumns to improve performance.
>  
> Whether you can modify the code is as follows:
> String updateClause =
>         
> {code:java}
> Arrays.stream(fieldNames)
> .filter(fieldName -> !Arrays.asList(uniqueKeyFields).contains(fieldName))
> .map(f -> quoteIdentifier(f) + "=EXCLUDED." + quoteIdentifier(f))
> .collect(Collectors.joining(", "));{code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)