Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature]Add support for rewriteBatchedStatements feature in r2dbc-mysql #136

Open
jchrys opened this issue Jul 19, 2023 · 1 comment
Open
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@jchrys
Copy link
Collaborator

jchrys commented Jul 19, 2023

Is your feature request related to a problem? Please describe.
Currently, there is no built-in support for rewriting batched statements, which results in performance issues when executing multiple statements as a batch.

Describe the solution you'd like
I would like to request the addition of a feature similar to rewriteBatchedStatements in mysql-connector-j. This feature allows the driver to automatically rewrite batched statements into a single multi-row insert statement, improving performance and reducing the network round-trips.

The proposed solution would involve implementing a mechanism in r2dbc-mysql that analyzes batched statements and intelligently combines them into a single multi-row insert statement, thus optimizing the execution and reducing overhead.

Additional context
Having support for the -rewriteBatchedStatements feature in r2dbc-mysql would greatly enhance the performance and efficiency of executing batched statements. This feature is already available in mysql-connector-j and is widely used by developers who work with JDBC.

https://dev.mysql.com/doc/connector-j/8.1/en/connector-j-connp-props-performance-extensions.html

@jchrys jchrys added enhancement New feature or request help wanted Extra attention is needed labels Jul 19, 2023
@jchrys jchrys changed the title [feature]Add support for -rewriteBatchedStatements feature in r2dbc-mysql [feature]Add support for rewriteBatchedStatements feature in r2dbc-mysql Jul 25, 2023
@mirromutth
Copy link
Contributor

A useful feature, this should require modifying Query.parse to determine whether the current statement is an INSERT or REPLACE that can be replaced, and to read the start/end indexes of valid VALUE/VALUES and the start/end indexes of subsequent brackets. In the final execution, the parentheses and the ? marks in the parentheses are multiplied by the size of bindings as a group.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants