ivy_duckdb Technical Design
ivy_duckdb adapts pg_duckdb to IvorySQL. It embeds DuckDB’s vectorized execution engine in IvorySQL and can analyze existing row-store tables directly.
1. Query execution path
SQL client -> IvorySQL -> pg_duckdb / DuckDB -> Scan IvorySQL row-store tables
The client submits SQL over its existing database connection. For a query that accesses only IvorySQL tables, duckdb.force_execution controls whether the extension attempts DuckDB execution. The extension can also handle queries that use DuckDB-specific features. DuckDB runs supported scans, filters, and aggregations and returns the result through the IvorySQL connection. Applications can keep using their existing tables, indexes, and write interfaces.
2. SQL and data type boundaries
The extension passes queries, column types, and results between IvorySQL and DuckDB. ivy_duckdb includes adaptations for IvorySQL’s Oracle-compatible types. Execution depends on the operators, functions, and data types in the query and the installed extension version.
To validate a workload, compare EXPLAIN, results, and execution time for the same SQL on the IvorySQL and DuckDB paths. Include date and time types, numeric precision, and implicit conversions in the comparison.
3. Resource use and data access
DuckDB queries run inside the instance and share CPU, memory, and I/O with transactional workloads. DuckDB memory and thread settings apply to each connection that uses the engine, so account for the number of concurrent analytics sessions. Direct analysis reads the source tables. For a continuously maintained columnstore copy, see the ivy_mooncake technical design.
See the ivy_duckdb project and DuckDB settings reference for configuration and version details.