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

Configurable Optimizer Query Plan Limits #4035

Open
oliver-hughes opened this issue Mar 26, 2024 · 1 comment
Open

Configurable Optimizer Query Plan Limits #4035

oliver-hughes opened this issue Mar 26, 2024 · 1 comment

Comments

@oliver-hughes
Copy link

Hi, at my company we use h2 as the database for running our test suite - approximately 9000 tests as of right now.
I've noticed that whilst running the suite, h2 was spending a lot of time in the Optimizer, determining a query plan for query executions. With such small sets of data that's being searched/retrieved during tests, all of this plan optimisation is generally a waste as even a sub-par plan will still retrieve the data quickly.

I tested with a custom build of h2 that allows setting/overriding the Optimizer parameters: OPTIMIZER_MAX_BRUTE_FORCE_FILTERS, OPTIMIZER_MAX_BRUTE_FORCE and OPTIMIZER_MAX_GENETIC via the connection URL. (added to DbSettings).
Setting these values to lower than the default resulted in the test suite running in around half of the original time.

Whilst this might not be recommended for those using h2 to run their application, I would imagine there are plenty of others out there that could benefit from the reduced optimizer overhead in testing situations.

Is this a change that would be considered if I were to make a pull request to add the functionality?

@grandinj
Copy link
Contributor

Sure, that sounds reasonable

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

No branches or pull requests

2 participants