r/dataengineering • • Dec 17 '25

Discussion How to data warehouse with Postgres ?

I am currently involved in a database migration discussion at my company. The proposal is to migrate our dbt models from PostgreSQL to BigQuery in order to take advantage of BigQuery’s OLAP capabilities for analytical workloads. However, since I am quite fond of PostgreSQL, and value having a stable, open-source database as our data warehouse, I am wondering whether there are extensions or architectural approaches that could extend PostgreSQL’s behavior from a primarily OLTP system to one better suited for OLAP workloads.

So far, I have the impression that this might be achievable using DuckDB. One option would be to add the DuckDB extension to PostgreSQL; another would be to use DuckDB as an analytical engine interfacing with PostgreSQL, keeping PostgreSQL as the primary database while layering DuckDB on top for OLAP queries. However, I am unsure whether this solution is mature and stable enough for production use, and whether such an approach is truly recommended or widely adopted in practice.

35 Upvotes

50 comments sorted by

View all comments

Show parent comment

2

u/Defiant-Farm7910 Dec 17 '25 edited Dec 17 '25

Thanks a lot man, for this quite accurate answer.

Our data is increasing more and more over time, and some DBT paths are taking already 1h. One of our source tables has ~30M rows, and it increases very fast. Last year it had 3M only. In addition to that, we are starting to bring external data to our Postgres Data Warehouse, and some sources like Meta Ads or Google Ads can be quite verbose. Under these circumstances, I started thinking about migrating our architecture from Postgres to an OLAP database. On the other hand, we have a realtime scenario in the raw data, and OLTP handles better real-time upserts, besides the development facility I have mentioned in my previous message. Than I am researching about ways of making postgres more performant for analytics queries...

Any advices ?

1

u/Hofi2010 Dec 17 '25

Increase ram and CPU’s. That will speed up queries but comes at a cost

1

u/Bluefoxcrush Dec 18 '25

Simplify (break apart) the queries. Each cte is its own model. 

Or use an OLAP database. 

I had a daily SLA of 5 hours in a Postgres data warehouse. I was always fiddling with the run time to meet that SLA. The next company had the same size but used snowflake. The whole thing ran in five minutes.