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:
- Point DuckDB at the file directly; no import step needed.
- Query files in place with read_csv/read_parquet.
- Push filters and column projection into the scan.
- Use Parquet for large or repeated reads.
- Aggregate and join across sources in one query.
- 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