Duckdb Query

Use when: run analytical queries in-process over files, Parquet, or CSV with DuckDB.

kimtth e2d14e4 1.1 KB Updated

File contents

Goal: fast local analytics without standing up a database server.

Use for:

  • ad hoc analysis of CSV, Parquet, or JSON files
  • embedded analytics inside an app or script
  • prototyping queries before moving to a warehouse

Workflow:

  1. Point DuckDB at the file directly; no import step needed.
  2. Query files in place with read_csv/read_parquet.
  3. Push filters and column projection into the scan.
  4. Use Parquet for large or repeated reads.
  5. Aggregate and join across sources in one query.
  6. Materialize results only when reuse justifies it.

Patterns:

  • query files as tables without loading them first
  • column pruning and predicate pushdown for speed
  • Parquet over CSV for large analytical workloads
  • COPY to export results to file formats

Rules:

  • prefer Parquet for repeated large scans
  • select only needed columns; avoid SELECT *
  • let DuckDB read files directly instead of pre-importing
  • keep it in-process; reach for a server db only when shared

kimtth/agent-skill-100-lines-or-less/tree/main/skills/duckdb-query commit e2d14e4b0b

Frequently asked questions

npx skillmds@latest add kimtth/duckdb-query