
VOPS: vectorized executor for Postgres
PostgreSQL looks very competitive with other mainstream databases on OLTP workload (execution of large number of simple queries). But on OLAP queries, requiring processing of larger volumes of data, DBMS-es oriented on analytic queries processing can provide an order of magnitude better speed. The following factors limit Postgres OLAP performance:
- Unpacking tuple overhead (tuple_deform)
- Interpretation overhead (Postgres executor has to interpret query execution plan)
- Abstraction penalty (support of abstract data types)
- Pull model overhead (operators are pulling tuples from heap page one-by-one, resulting numerous repeated accesses to the page)
- MVCC overhead (extra per-tuple storage + visibility check cost)
All this issues can be solved using vectorized executor, which proceed bulk of values at once. In this presentation I will show how vector operations can be implemented in Postgres as standard Postgres extension, not affecting Postgres core. The approach is based on introducing special types: tile types, which can be used instead of normal (scalar) types and implement vector operations. Postgres extension mechanism, such as UDT (user-defined type), FDW (foreign data wrappers), executor hooks are used to let users work with vectorized tables almost in the same way as with normal tables. But more than 10 times faster because of vector operations.