Skip to content

testkit(derby): close(key) drops the key's in-memory database; a hash join may hold 64 MB of a table - #69

Merged
stbischof merged 2 commits into
mainfrom
pr/testkit-derby
Nov 10, 2026
Merged

stbischof merged 2 commits into
mainfrom
pr/testkit-derby

Conversation

@stbischof

Copy link
Copy Markdown
Contributor
  • DerbyDatabaseProvider.close(key) drops the in-memory database of the key (drop=true), as the H2 and DuckDB providers do; close() drops every database the provider opened.
  • The provider sets derby.language.maxMemoryPerTable to 64 MB where it is not set: above 1 MB per table, Derby's default, it joins a derived table by nested loops instead of a hash join.

Derby keeps an in-memory database for the whole JVM until it is dropped,
its connections closed or not. A caller that opens one database per key
gives it back with close(key), as with H2 and DuckDB; close() drops every
database the provider opened.

Signed-off-by: Stefan Bischof <stbischof@bipolis.org>
Derby gives a hash join 1 MB per table by default and joins a larger derived
table by nested loops, once per row of the other side. The test kit raises
derby.language.maxMemoryPerTable to 64 MB.

Signed-off-by: Stefan Bischof <stbischof@bipolis.org>
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
54.8% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@stbischof
stbischof merged commit 1387d10 into main Nov 10, 2026
7 of 9 checks passed
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

Successfully merging this pull request may close these issues.

1 participant