Overview

pg_mooncake is a PostgreSQL extension adding columnstore tables with DuckDB execution for 1000x faster analytics. Columnstore tables are stored as Iceberg or Delta Lake tables in your Object Store. Maintained by Mooncake Labs, it is available on Neon Postgres.

CREATE EXTENSION pg_mooncake;
 
CREATE TABLE user_activity(
    user_id BIGINT,
    activity_type TEXT,
    activity_timestamp TIMESTAMP,
    duration INT
) USING columnstore;

Use Cases

1. Analytics on PostgreSQL data: full columnstore table + vectorized execution (DuckDB).

2. Time Series & Log Analytics in PostgreSQL: columnar format + segment elimination.

3. Exporting PostgreSQL Tables to Your Lake or Lakehouse.

4. Query and update existing Lakehouse tables and Parquet files directly in PostgreSQL.

Another PostgreSQL analytics extension?

There have been attempts at addressing 'fast analytics' in Postgres.

Early projects like Citus and Timescale added columar storage, but there was no good vectorized excuection to leverage the format.

Projects like pg_duckdb bring the vectorized execution engine; but Postgres itself lacks a columnar storage format to leverage it.

pg_mooncake brings a columnstore table with both storage and compute that can leverage the format.

map