-
Notifications
You must be signed in to change notification settings - Fork 285
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
sql store performance enhancement #1132
Comments
I will dig deeper into it. A quick test shows about a 4x gain, which is good! |
bulk insertion NOT within another transaction seems fastest. |
@carr123 Understood. |
kozlovic
added a commit
that referenced
this issue
Jan 8, 2021
A new configuration `bulk_insert_limit` switches the server from the current insertion of messages within a SQL transaction, to an "INSERT INTO MESSAGES () VALUES (),(),..." which can speed up performance by several folds. The server still may perform regular insert within transaction if the limit is deemed too low. This new configuration parameter is not enabled by default. It needs to be explicitly set, either in configuration file or from command line `--sql_bulk_insert_limit <number here>`. Resolves #1132 Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
kozlovic
added a commit
that referenced
this issue
Jan 8, 2021
A new configuration `bulk_insert_limit` switches the server from the current insertion of messages within a SQL transaction, to an "INSERT INTO MESSAGES () VALUES (),(),..." which can speed up performance by several folds. The server still may perform regular insert within transaction if the limit is deemed too low. This new configuration parameter is not enabled by default. It needs to be explicitly set, either in configuration file or from command line `--sql_bulk_insert_limit <number here>`. Resolves #1132 Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
hi, i read the nats-streaming-server sql store souce code. it seems that, a sql transaction is used (begin, preparedStmts, commit) to bulk insert messages.
but , i think this kind of bulk insertion [insert into tb values(1, 'a'),(2,'b'),(3,'c')] is more performant than the above.
The text was updated successfully, but these errors were encountered: