Issue 173 bytea jdbctype#182
Conversation
Allocation profiling results: boot-time-verbose import (50 runs, batch=5, cores=4, 8GB heap)Profiled with async-profiler Baseline (no fixes — JSONB, sql/sqlall nodes, String encoding)
Result: OOM at ~50s, ~4,200 values processed before crash. With #154 only (sql→jq, but still JSONB + String encoding)
Result: OOM at ~60s, ~10,150 values. Faster throughput but higher peak allocation from in-memory jq evaluation. With all fixes including #173 BYTEA + JqValueJdbcType
Result: Completes successfully in 105s, 28,200 values. No OOM. Summary of #173 impact
The Performance comparison
3.2x throughput improvement and the import actually completes on 8GB heap for the first time. |
55b6fd3 to
5a1da4b
Compare
b8e3009 to
2bd7590
Compare
…qValue persistence (issue Hyperfoil#173) Switch ValueEntity.data from JSONB to BYTEA with JqValueJdbcType from jjq-jakarta 0.1.7, enabling direct byte[]-based JDBC I/O: Write: JqValues.serializeToBytes(value) -> setBytes() (near-zero alloc) Read: getBytes() -> JqValues.parse(byte[]) (SWAR-optimized) This eliminates the String intermediaries that dominated allocation during bulk imports: toJsonString() on writes, String.encodeUTF8 for JDBC encoding, and getString() decoding on reads. Changes: - ValueEntity.data: JSONB -> BYTEA, @JdbcType(JqValueJdbcType.class), @javatype(JqValueJavaType.class), remove @mutability (handled by JqValueJavaType ImmutableMutabilityPlan) - Delete DatabaseJsonFormatMapper (FormatMapper no longer needed) - Remove quarkus.hibernate-orm.mapping.format.global=ignore - Update jjq dependency to 0.1.7 (released) - WorkService: native UPDATE uses setBytes() with serializeToBytes(), remove dbKind switch (same SQL for both databases) - ValueService fingerprint matching: BYTEA equality (v.data = :fp), pass byte[] parameter via serializeToBytes() - ValueService domain comparison: convert_from(v.data, 'UTF-8')::jsonb for PostgreSQL, CAST(v.data AS TEXT) for SQLite - ValueService sorter CTE: convert BYTEA to jsonb/text for domain ordering (fixes E-Divisive lexicographic byte sorting) - ValueService aggregation (getGroupedValues): convert BYTEA to jsonb/text in tree CTE base case - Unify sqlite/postgresql SQL where BYTEA makes them identical - VerifyLegacy: convert_from for text display - RecalculateTest: use byte[] parameter for native UPDATE
2bd7590 to
070088e
Compare
No description provided.