liveBook · Manning

Query engine

As explained in DuckDB in Action

A query engine is the database component that transforms submitted queries into computed results.

A query engine transforms submitted queries into computed results. DuckDB processes queries through an SQL parser, query execution planner, and query runtime; its vectorized engine processes data chunks in parallel for efficient use of multicore CPUs. section 1.1

Use the engine to:

  • Analyze files and pipeline data without persisting them in DuckDB, including JSON, CSV, and Parquet sources. section 5.8
  • Filter, aggregate, convert types, flatten JSON, enrich data through joins, and encapsulate transformations with views. section 5.8
  • Query pandas DataFrames directly through SQL or a relational API, then retrieve results as cursors or DataFrames. section 6.3

Query a pandas DataFrame

Create a DataFrame named people with name and country columns, then run `SELECT * FROM people WHERE country = 'Germany'`. The result contains Michael Hunger and Michael Simons. A parameterized query can select people outside Germany and return the result with `fetchdf()` for continued pandas analysis. section 6.3

Figure 1.2 A high-level overview of DuckDB’s query-processing pipeline
figure

Follow the high-level query-processing pipeline from submitted SQL through parsing, planning, and runtime execution. section 1.1

How DuckDB in Action covers it

How deep it goes
Explains parsing, planning, runtime, and vectorized execution, then stops short of implementation internals.
Examples
Demonstrates filtering an authors DataFrame, parameterized queries, cursor results, DataFrame results, and relational chaining.
What it assumes
Assumes familiarity with SQL-like filtering and DataFrames while demonstrating direct integration from installation through result retrieval.
What you can do after
Apply it via DuckDB to query files, pipelines, external stores, and pandas DataFrames without duplicating datasets.
How it connects
Connects SQL parsing, query planning, query runtime, pandas DataFrames, JSON, CSV, Parquet, views, and external databases.

Also explained in

Compare how 3 books explain query engine →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of DuckDB in Action. The section links point to the parts of the book it draws on.