A Comprehensive Guide to In-Memory Analytical Processing
Introduction: Why DuckDB?
- The Analytical Data Problem
- Enter DuckDB: A Different Kind of Database
- When to Use (and Not Use) DuckDB
- How This Book Is Organized
Chapter 1: Architecture and Internals
- Vectorized Query Execution Explained
- The Columnar Storage Engine
- Query Optimization Pipeline
- Memory Management Model
- Concurrency and Threading
Chapter 2: Getting Started with DuckDB
- Installation Across Platforms
- The DuckDB Command-Line Interface
- Your First Analytical Queries
- Working with Databases and Connections
- Basic Data Exploration Workflow
Chapter 3: Data Types, Schemas, and Tables
- Sample Database Setup for Chapters 3 through 7
- Primitive and Composite Data Types
- Structs, Lists, Maps, and Unions
- Creating and Managing Tables
- Constraints and Integrity
- Temporary and Transient Tables
Chapter 4: Core SQL Operations
- SELECT Statements and Projection
- Filtering with WHERE and Boolean Logic
- Sorting, Limiting, and Offset
- DISTINCT and Deduplication Patterns
- Common Pitfalls and Best Practices
Chapter 5: Joins and Set Operations
- Inner Joins and Outer Joins
- Cross Joins and Semi/Anti Joins
- Join Algorithms and When DuckDB Chooses Each
- UNION, INTERSECT, EXCEPT
- Large-Scale Join Strategies
Chapter 6: Aggregations and Window Functions
- GROUP BY and Aggregate Functions
- HAVING and Filtering Aggregates
- Window Functions Syntax and Semantics
- Analytical Patterns with Windows
- Performance Considerations for Heavy Aggregation
Chapter 7: Advanced SQL Features
- Common Table Expressions (CTEs)
- Subqueries and Correlated Queries
- Views and Materialized Patterns
- Macros and Procedural Extensions
- Transactions and Isolation Levels
- LATERAL Joins for Row-by-Row Computation
- PIVOT and UNPIVOT for Data Reshaping
- QUALIFY Clause for Window Function Filtering
- SAMPLE Clause for Efficient Data Sampling
- POSITIONAL Joins for Row-Order Matching
- Advanced STRUCT Operations
Chapter 8: Data Ingestion and Export
- CSV Import and Export
- JSON Processing
- Parquet Integration
- Avro, ORC, and Other Formats
- COPY Statements and Bulk Operations
Chapter 9: The Extensions Ecosystem
- Extension Architecture and Loading
- Spatial and Geospatial Extensions
- HTTP and Web Data Access
- Apache Iceberg and Delta Lake
- MotherDuck and Cloud Integration
Chapter 10: Programming APIs and Language Bindings
- Python API and duckdb Package
- R Integration via dbplyr and duckdb
- Java and JDBC Connectivity
- C/C++ Embedding API
- Go, Rust, Node.js, and Other Bindings
Chapter 11: DataFrame and Ecosystem Integrations
- Pandas Integration and Lazy Evaluation
- Polars and Arrow Interoperability
- Apache Arrow Flight and Memory Sharing
- Ibis Integration
- dbt and Data Transformation Workflows
- Jupyter, Notebooks, and Interactive Analysis
Chapter 12: Performance Engineering
- Understanding Vectorized Execution Performance
- Parallel Query Execution Tuning
- Storage Layout and Compression Strategies
- Predicate Pushdown and Projection Pushdown
- Late Materialization
- Join Optimization and Hash Tables
- Memory Limits, Caching, and Spilling
- Reproducible Benchmark Suite
Chapter 13: Embedding DuckDB in Applications
- The Embedded Database Paradigm
- Building Analytics Into Your Application
- Connection Management and Lifecycle
- Packaging and Distribution Considerations
- Real-World Embedding Patterns
Chapter 14: Production Deployment and Operations
- Security Model and Access Control
- Configuration and Pragmas Reference
- Profiling Queries and Debugging Performance
- Migration Strategies from SQLite and PostgreSQL
- Enterprise Patterns and Best Practices
Conclusion: The Future of Analytical Databases
- Where DuckDB Fits in the Modern Stack
- Emerging Trends and Capabilities
- Choosing Your Tool: A Decision Framework
References
Index
- A
- B
- C
- D
- E
- F
- G
- H
- I
- J
- L
- M
- N
- O
- P
- Q
- R
- S
- T
- U
- V
- W
- Z