Skip to content

Use sequences of MariaDB, don't treat it as MySQL #4217

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

Closed
Master-Code-Programmer opened this issue Oct 21, 2022 · 3 comments
Closed

Use sequences of MariaDB, don't treat it as MySQL #4217

Master-Code-Programmer opened this issue Oct 21, 2022 · 3 comments

Comments

@Master-Code-Programmer
Copy link

Expected Behavior
For MariaDB its, now for 4 years existing, native sequences get used, not the simulated sequences like MySQL needs them. This is a performance advantage of MariaDB against MySQL, since the code to simulate sequences isn't that simple. It would also be easier to maintain.
Link: https://mariadb.com/kb/en/sequence-overview/
Command to get next value: NEXTVAL(sequence_name).

Current Behavior
Spring Batch uses MySQLs sequence simulation of the MySQLMaxValueIncrementer, whose core method is 80 lines long and all but simple. But it seems it could use something like the far slimmer OracleSequenceMaxValueIncrementer, whose core method is a primitive one-liner.

Context
Ignoring this feature of MariaDB is inefficient.

@fmbenhassine
Copy link
Contributor

We had a discussion about this in #3891, which depends on spring-projects/spring-framework#29306.

The addition of a dedicated incrementer for MariaDB in Spring Framework does not seem to be planned for SF 6, so I suggest we create one in Spring Batch (like we did for SQLServer) to implement this feature in SB 5, and then replace it with the one from SF when it is ready.

I will plan this for the upcoming 5.0 RC2.

@fmbenhassine fmbenhassine added in: core and removed status: waiting-for-triage Issues that we did not analyse yet labels Oct 24, 2022
@fmbenhassine fmbenhassine added this to the 5.0.0-RC2 milestone Oct 24, 2022
@jhoeller
Copy link

@fmbenhassine We can pick this up for Spring Framework 6.0 RC3 still, so if you have a candidate implementation for Batch 5, feel free to post it on spring-projects/spring-framework#29306 (or create a separate PR for it).

@fmbenhassine
Copy link
Contributor

@jhoeller That's a great news! Thank you. I will open a PR for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants