OceanBase VSAG Index: Solving MyBatis Batch Insert Timeouts
saveBatch with a batch size of 200 is triggering consistent transaction timeouts in OceanBase 4.3.3 when writing 1536-dimensional embedding vectors. The failure is specific to tables where a VSAG vector index is active.The error is explicit:
JDBC SQLState: XA102, Error Code: 4012 - Transaction timeout or statement timeout exceededAfter running some tests, the bottleneck is definitely the index. If I drop the VSAG index, the same 50,000 record payload finishes in seconds. Even after cranking ob_query_timeout and ob_trx_timeout to 120s+, the batches still crash. It looks like the synchronous overhead of maintaining the graph-based index during the write is holding locks too long, causing a pile-up.
I'm trying to figure out if there is a way to handle this via a more efficient AI workflow for data ingestion. Specifically, I need to know if OceanBase supports asynchronous VSAG index maintenance or a deferred build mode to prevent these synchronous blocks during high-throughput inserts.
For anyone else doing a deep dive into OceanBase vector deployment, here is my current setup:
- Database: OceanBase 4.3.3 (MySQL mode)
- Table Config: Hash partitioned
- Index: Native VSAG on
vector_data(1536-dim) - Framework: Spring Boot + MyBatis-Plus
If you've found a specific session variable to decouple the graph construction from the transaction commit, or a better batch tuning pattern for vector data, I'd appreciate the lead.