Skip to main content

PostgreSQL for Analytics on Aiven for PostgreSQL® Early availability

Run analytical SQL queries directly against an Aiven for PostgreSQL® service by adding Iceberg tables backed by object storage you own. Your data stays where it is, with no separate warehouse to copy it to.

note

PostgreSQL for Analytics is in early availability. Request access to use it.

About PostgreSQL for Analytics​

PostgreSQL for Analytics adds columnar, Apache Iceberg table storage to an Aiven for PostgreSQL service through the pg_lake set of extensions. Iceberg tables store their data as Parquet files in a storage bucket that you provide, while the catalog that tracks those tables lives in your PostgreSQL database. You query the Iceberg tables with standard SQL from the same connection you already use for your operational database.

Benefits​

  • No separate warehouse: Query Iceberg tables from the same PostgreSQL connection you use for your operational workload.
  • No separate pipeline to run: Move data into Iceberg tables with SQL inside PostgreSQL, with no connectors, streaming tools, or external scheduler to maintain.
  • Open storage format: Data is stored as standard Apache Iceberg tables in a bucket you own, not in a proprietary format inside the database.
  • Faster analytical queries: Queries against Iceberg tables run on DuckDB, a columnar, vectorized query engine, instead of PostgreSQL's row-based executor. This speeds up queries that scan or aggregate large datasets.

When to use PostgreSQL for Analytics​

Iceberg tables suit data you append and analyze: events, logs, time-series data, and the reports that strain your operational database today. Keep your application on regular PostgreSQL tables and use Iceberg tables for history.

They're a poor fit for rows that change constantly, for work that needs indexes or upserts, and for results that must be accurate to the second. If you copy data in from regular PostgreSQL tables, the Iceberg copy is only as current as your last load.

How PostgreSQL for Analytics works​

PostgreSQL for Analytics builds on pg_lake, which runs DuckDB as a separate analytical query engine alongside PostgreSQL in your service. When you run a query against an Iceberg table, PostgreSQL forwards the analytical parts of that query to DuckDB, which reads and writes the underlying Parquet files in your bucket.

Aiven divides the service's resources between PostgreSQL and DuckDB. Each engine gets roughly half of the service's memory. CPU isn't reserved: when the service is busy, the two engines get an even share, and when one is idle the other can use the spare capacity.

Limitations​

Service and plan​

  • PostgreSQL for Analytics is set when the service is created, so you enable it on a new service. See Create your service.
  • PostgreSQL gets roughly half of the service's memory because it shares the service with DuckDB, so its connection limit is lower than on a regular service with the same plan.
  • DuckDB caches Iceberg data on the service's disk, so choose a plan with room for both engines.
  • PostgreSQL for Analytics runs on PostgreSQL 17. Major version upgrades aren't available yet.
  • Forks, point-in-time recovery, read replicas, cross-region disaster recovery, and backup to another region aren't available for these services. You can power the service off.

Storage​

  • Amazon S3 and Google Cloud Storage are the supported storage.
  • You connect your own bucket, and each service needs its own. For the best performance and to avoid data transfer charges, keep the bucket in the same region as your service. See Connect your storage bucket.
  • Every Iceberg table needs an explicit location inside the bucket and path you connected. See Create an Iceberg table.
  • Aiven backups cover your PostgreSQL data but not the contents of your bucket. Back up and retain that data with your cloud provider's tools.
  • Only your service writes to the Iceberg tables it creates. Writing to their bucket path from other services or engines, such as Trino or Apache Spark™, can corrupt the tables. Reading them from outside your service isn't available yet.

SQL and data types​

  • Iceberg tables support INSERT, UPDATE, DELETE, and SELECT, but not MERGE, INSERT ... ON CONFLICT, SELECT ... FOR UPDATE, SELECT ... FOR SHARE, or queries that use system columns such as ctid. For upsert behavior, stage your changes in a regular PostgreSQL table and apply them as a DELETE followed by an INSERT in one transaction.
  • Writes to one Iceberg table are serialized. If two INSERT statements target the same table at once, the second starts after the first commits.
  • Numeric columns without a declared precision and scale are stored as double precision, which loses exact decimal semantics. See Create an Iceberg table.

Loading and maintenance​

  • You load data into Iceberg tables with SQL, and schedule loads yourself with pg_cron. See Load data into Iceberg tables.
  • An autovacuum worker compacts Iceberg tables and expires old snapshots for you. You can also run VACUUM yourself. See Maintain Iceberg tables.
  • Aiven keeps the pg_lake extension and the extensions installed with it up to date, upgrading them during maintenance updates to stay in sync with DuckDB.

Performance​

  • PostgreSQL for Analytics runs on a single node, so query performance scales with the plan you choose.
  • Iceberg table data is read from and written to object storage, which adds latency to every query. Queries that scan or aggregate large datasets can still run faster than on regular PostgreSQL tables, but queries that read only a few rows are usually faster on regular tables.

Related pages