01 / PG_MOONCAKE · COLUMNSTORE MIRROR
One command to mirror any Postgres table
◇ Native USING mooncake Table Access Method + Logical Replication
- Creates a read-only
USING mooncakemirror of any heap or partitioned table - Keeps your OLTP write path 100% unchanged—no triggers or dual writes
- Can replicate from the local database or a remote PostgreSQL
src_uri
Turn slow analytical queries into sub-second vectorized scans.
-- Enable pg_mooncake (auto-loads pg_duckdb 1.2.0)
CREATE EXTENSION IF NOT EXISTS pg_mooncake CASCADE;
-- Create a real-time columnstore mirror of orders
CALL mooncake.create_table('orders_analytics', 'orders');
-- Write to rowstore, query from columnstore
INSERT INTO orders (customer_id, amount) VALUES (42, 199.95);
SELECT customer_id, SUM(amount) FROM orders_analytics
GROUP BY customer_id;