> A data warehouse on the other hand is an OLAP database and is optimized to work on columns
A bit of a pedantic nit here: a data warehouse is a usage pattern. It’s not necessarily tied to any specific technology, however it is commonly implemented with OLAP systems like Snowflake, BigQuery, etc. But there’s nothing stopping you from building out your data warehouse in Postgres or MySQL. If you’re stitching together disparate datasets to build a unified model for analytics, you’ve got yourself a data warehouse no matter what system it lives on.
You are pedantically correct but technically wrong, as even optimized postgres is going to suffer on analytical patterns without extensions. With extensions (DuckDB or Citus) you can do large aggregations, but regular postgres at medium/large scale (billions of rows, 100s of GB) starts having a lot of foot guns and complex babying to do analytics. A bunch of indexes and you'll be fine though.
> But there’s nothing stopping you from building out your data warehouse in Postgres or MySQL.
Other than money and time.