# Query Engine

> A tool that runs SQL on data kept somewhere else.

**Field:** Data Engineering  
**Category:** Analytics & BI  
**Also known as:** SQL Query Engine, Distributed Query Engine, SQL Engine

## Think of it like

It is like a helper who can fetch books from many libraries. You ask once, and the books all come back.

## Definition

A query engine runs SQL over data that it does not store itself. The data stays where it is, in files in a data lake or in other databases. The engine reads it, splits the work across many machines and returns one answer. A warehouse stores and queries its own data. A query engine only does the querying. This split lets one engine read many kinds of storage.

## Example

A team keeps its events as Parquet files in object storage. A query engine runs SQL on them directly, with no load step.

## Why it matters

A firm can query its data lake with plain SQL. It does not have to copy it all into a warehouse first.

## Common mistake

Hoping for warehouse speed on messy files. Lots of tiny files, or files not split by date, make each query slow.

## Three principles

- **Queries only.** Storage lives somewhere else.
- **Many machines.** The work is split up.
- **Many sources.** Files, lakes and databases.

## Related terms

- [Trino](https://learn.benibix.com/term/data/trino)
- [Presto](https://learn.benibix.com/term/data/presto)
- [DuckDB](https://learn.benibix.com/term/data/duckdb)
- [Data Lake](https://learn.benibix.com/term/data/data-lake)
- [Federated Query](https://learn.benibix.com/term/data/federated-query)
- [Structured Query Language (SQL)](https://learn.benibix.com/term/development/sql)
- [Amazon Athena](https://learn.benibix.com/term/data/amazon-athena)

## Told apart from

- [Query Engine vs Data Warehouse](https://learn.benibix.com/compare/query-engine-vs-data-warehouse): People think a query engine is a data warehouse. A warehouse keeps the data and runs the queries, all in one product. A query engine only runs the queries. The data stays in files or other databases, and the engine reads it where it is. Both speak SQL, so from the outside they can look the same.

![One SQL query goes into a query engine made of a coordinator and three workers. Connectors lead from the workers to three places the data lives: a PostgreSQL database, Parquet files in a data lake and a Kafka topic. The answer comes back as one table.](https://learn.benibix.com/diagrams/query-engine.svg)

---

Source: https://learn.benibix.com/term/data/query-engine
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-16
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
