Glossary · Database
Federated Query
A federated query is a single query that pulls and combines data from multiple separate databases or data sources as if they were one system.
Federation answers questions that no single database can: joining customers in Postgres against support tickets in another system, in one query, without first copying everything into a warehouse. Engines like Trino and Presto, and features like Postgres foreign data wrappers, make this possible by translating one query into sub-queries against each source and stitching the results. The appeal is skipping ETL; the catch is performance–cross-source joins move data over the network and can be slow. Federation suits occasional cross-system questions, while frequently combined data usually still belongs in a warehouse.
In practice
How AI for Database applies it
Fig — every answer ships with the tables, rows and SQL behind it.
See it on your own database
Connect read-only in minutes. Free models included.