graph-query-support
Issue: #124 Date: 2026-01-30T16:30:21-08:00
Summary
Yes, DuckDB supports graph queries through the DuckPGQ community extension, which implements the SQL/PGQ standard from SQL:2023. This allows you to perform graph pattern matching and path-finding operations directly within DuckDB without needing a separate graph database.
Key Findings
Native Graph Query Support
- DuckDB doesn’t have built-in graph query support in core, but the DuckPGQ community extension adds SQL/Property Graph Query (SQL/PGQ) capabilities
- SQL/PGQ is part of the official SQL:2023 standard, providing standardized syntax for graph operations
Core Capabilities
- Pattern matching: Find specific patterns in connected data
- Path-finding: Discover paths in your data, including variable-length paths
- Property graph model: Label and assign properties to nodes and edges
- Supports use cases like social networks, financial transaction analysis, and knowledge graphs
Technical Approach
- DuckPGQ leverages DuckDB’s analytical capabilities to perform efficient, in-process graph analytics
- Requires no external dependencies
- Easy to install as a community extension
- Allows you to work with graph data without exporting or managing a separate system
Current Status
- DuckPGQ is actively maintained as a community extension (started as a research project)
- Under ongoing development with recent activity as of October 2025
- Some features may still be incomplete, so check documentation for your specific use case
Recommendations
If you need graph query capabilities in DuckDB:
- Install the DuckPGQ extension
- Review the SQL/PGQ documentation to understand the syntax
- Test with your specific graph patterns to ensure they meet your needs
- Monitor the extension’s GitHub repository for updates and known limitations