OceanBase TPC‑C Benchmark: SQL Optimization and Storage‑Procedure Techniques
This article, the third in a five‑part series on OceanBase’s record‑breaking TPC‑C results, explains the SQL‑level challenges faced during the benchmark and details the optimizations—including stored procedures, LLVM‑based compilation, array binding, prepared statements, and updatable views—that enabled the performance gains.
Ant Financial’s self‑developed OceanBase database recently topped the TPC‑C benchmark, prompting a five‑article technical deep‑dive by core developers; this third article focuses on the SQL module’s challenges and optimizations.
Background : TPC‑C is a rigorous OLTP benchmark that measures transaction per minute (tpmC) and system cost, stressing short‑latency, high‑concurrency workloads. It models five transaction types—order creation, payment, query, shipment, and stock query—each lasting only a few milliseconds.
Stored Procedures : By moving business logic into the database, stored procedures reduce client‑server round‑trips, cutting network overhead (≈30% of CPU) and shrinking transaction lock contention, thereby boosting overall throughput.
Compilation Execution : OceanBase leverages the LLVM framework to JIT‑compile stored procedures into efficient native code, achieving order‑of‑magnitude speed improvements and cross‑platform portability.
Array Binding : Batch processing of DML statements with identical execution plans eliminates repeated plan generation; OceanBase uses the FORALL keyword to apply this technique, significantly increasing TPC‑C throughput.
Prepared Statements & Plan Cache : OceanBase supports binary prepared‑statement protocols both from client applications and within stored procedures, caching execution plans and reducing parsing overhead to microseconds.
Updatable Views : By defining updatable views, OceanBase can combine multiple logical operations into a single statement, further reducing interaction count while preserving ACID semantics; the technique complies with TPC‑C rules that forbid materialized views.
Conclusion : The optimizations described are broadly applicable to any high‑concurrency OLTP system, demonstrating how stored procedures, JIT compilation, array binding, and plan caching collectively enhance performance. OceanBase’s continued focus on autonomous development and Oracle compatibility positions it for future scalability.
Authors : Chen Mengmeng and Pan Yi, senior technical experts from Ant Financial’s OceanBase team.
AntTech
Technology is the core driver of Ant's future creation.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.