Skip to content

Introducing Prestissimo, Presto's Next-Gen Query Execution Engine

Aditi Pandit

Blue TeamThe Linux Foundation35 minOpen on YouTube ↗

Evaluates introducing Prestissimo, Prestos Next-Gen Query Execution Engine and evaluates key implications for security practitioners.

Summary

### Overview In this presentation, Aditi Pandit, Principal Engineer at Ahana (recently acquired by IBM), introduces Prestissimo, the next-generation C++ query execution engine for Presto. Presto is a widely used open-source distributed SQL query engine designed for analytics and open data lakehouses, deployed at massive scale across organizations such as Meta, Uber, and ByteDance. While Presto's coordinator coordinates query planning, optimization, and scheduling, execution historically relied on Java-based worker nodes. Prestissimo addresses the operational bottlenecks and performance cliffs associated with the Java Virtual Machine (JVM) by replacing the worker nodes with a high-performance C++ implementation powered by the Velox library.

### Key Topics - **Presto Architecture and JVM Limitations**: Traditional Presto clusters use a coordinator to parse queries, generate plan stages/fragments, and distribute them to Java workers. In production, Java-based workers suffered from operational friction, primarily garbage collection (GC) pauses that introduced sudden performance cliffs for end users. - **Introducing Prestissimo**: Prestissimo serves as a drop-in C++ replacement for the Java worker. It implements the exact same HTTP communication interfaces, status reporting endpoints, and exchange wire protocols for data serialization and deserialization, enabling seamless integration with the existing Presto coordinator. - **The Velox Foundation**: Prestissimo wraps Meta's open-source C++ library Velox, which provides reusable, vectorized data processing building blocks across diverse engines (including Apache Spark via Gluten, PyVelox, and TorchArrow). - **Benchmark Results**: On AWS TPC-H benchmarks running against uncompressed Parquet on Amazon S3, Prestissimo demonstrated a 4.3x improvement in query throughput, a 2.6x reduction in elapsed wall-clock time, a ~3x reduction in CPU time, and a 1.3x improvement in memory efficiency compared to the Java worker.

### Technical Details - **Vectorized Execution & Memory Management**: Velox operates entirely on columnar vectors supporting flat, constant, and dictionary encodings. Dictionary encoding enables expression evaluation strictly on distinct values and streamlines null handling. Memory is managed through hierarchical memory pools and an Umbra-inspired buffer pool design, avoiding intermediate data copies and eliminating GC overhead. - **Pipeline and Driver Model**: Velox converts query plan nodes (such as TableScan, FilterProject, HashAggregation, and OrderBy) into execution operators. The Velox driver orchestrates these operators within a single execution thread, pulling data via a pull-based `getOutput` model across pipelined operators. Parallelism is achieved by instantiating multiple driver pipelines per partitioned task. - **Adaptive Optimizations and Spilling**: Velox incorporates adaptive hash table implementations (e.g., transitioning from direct/radix-based addressing to normalized keys or full hash functions depending on cardinality and data distribution). Its Spiller framework enables memory-intensive operators (like hash joins and aggregations) to spill sorted partitions to disk, enabling dynamic memory arbitration across competing operators and queries. - **Connectors and Parquet Reader**: Prestissimo leverages a rewritten C++ Parquet reader optimized to leverage file metadata (such as min/max column statistics) for row-group pruning. While the Hive connector is mature, ongoing work covers full SQL compliance (such as specific decimal/character types and specialized optimizer nodes like MarkDistinct).

### Takeaways Prestissimo modernizes Presto's worker tier by swapping Java runtime execution for native C++ powered by Velox. The architecture delivers significant performance acceleration, CPU efficiency, and predictability by eliminating JVM GC pauses. Furthermore, because Velox acts as a shared, vectorized substrate across multiple open-source engines, performance improvements and storage optimizations benefit a broader unified analytics ecosystem.

Related talks