Home / Companies / QuestDB / Blog / Post Details
Content Deep Dive

How we built a SIMD JIT compiler for SQL in QuestDB

Blog post from QuestDB

Post Details
Company
Date Published
Author
Andrey Pechkurov
Word Count
1,873
Language
English
Hacker News Points
-
Summary

QuestDB, an open-source time-series database designed for high-performance workloads, has introduced a new Just-in-Time (JIT) compiler in its SQL engine as part of version 6.2.0. This addition aims to significantly speed up query execution, particularly for queries involving simple arithmetic expressions by improving CPU usage efficiency. The JIT compiler achieves this by compiling filter expressions into machine code, optimizing execution through vectorized processing using SIMD instructions, which allows processing multiple rows simultaneously. Currently, the JIT compiler is a beta feature and primarily supports x86-64 CPUs with AVX2 instructions, targeting filters with arithmetic expressions on fixed-size columns. Initial benchmarks indicate substantial performance improvements in CPU-bound scenarios where data is already cached, with execution times reduced by 76% compared to the previous Java implementation. QuestDB plans to expand the compiler's capabilities to support ARM64 CPUs, parallelize query execution, and address current limitations, inviting user feedback and contributions to further refine the feature.