⌘K ctrl+k
Search Shortcut cmd + k | ctrl + k
DuckDB 2.0 ドキュメント 全文検索
per page, with , order by , clip by
Results of 1 - 10 of about 30 for plan (0.002 sec.)
EXPLAIN: Inspect Query Plans 13370
EXPLAIN SELECT * FROM tbl; The EXPLAIN statement displays the physical plan, i.e., the query plan that will get executed, and is enabled by prepending the query with EXPLAIN . The physical plan is a tree of operators that are executed in a ... specific order to produce the result of the query. To generate an efficient physical plan, the query optimizer transforms the existing physical plan into a better physical plan. To demonstrate, see the below exam ... that can be used to control the output. The following settings are available: The default setting. Only shows the physical plan. SET explain_output = 'physical_only'; Shows only the optimized plan. SET explain_output = 'optimized_only'; Shows both th ... e physical and optimized plans. SET explain_output = 'all'; See Also For more information, see the ”Profiling” page . ...
https://man.mtool.work/duckdb/2.0/guides/meta/explain.html
Metrics 11112
DuckDB provides a set of metrics that can be used to monitor the performance and health of the database. Metrics are named ⟨group⟩.⟨metric⟩ , e.g., query.total_time or operator.timing . The set of collected metrics is controlled with the tr ... rics(); All Metrics The metrics are organized into the following groups: query system io storage operator optimizer parser planner physical_planner query Metrics Metrics measured over the entire query. Name Type Unit Description query.cpu_time double ... double seconds Time spent writing to the WAL operator Metrics Metrics collected for each individual operator in the query plan. These are reported in the operator tree of the profiling output. Name Type Unit Description operator.cpu_time double seco ... alization , optimizer.cte_inlining , optimizer.row_group_pruner , optimizer.top_n_window_elimination , optimizer.common_subplan , optimizer.join_elimination , optimizer.window_self_join , optimizer.projection_pullup , optimizer.outer_join_simplificat ...
https://man.mtool.work/duckdb/2.0/dev/metrics.html
Profiling 11112
Profiling is essential to help understand why certain queries exhibit specific performance characteristics. DuckDB contains several built-in features to enable query profiling, which this page covers. For a high-level example of using EXPLA ... IN , see the “Inspect Query Plans” page . Statements The EXPLAIN Statement The first step to profiling a query can include examining the query plan. The EX ... PLAIN statement shows the query plan and describes what is going on under the hood. The EXPLAIN ANALYZE Statement The query plan helps developers understand th ... cardinalities that pass through them. The EXPLAIN ANALYZE statement enables obtaining these, as it pretty-prints the query plan and also executes the query. Thus, it provides the actual run-time performance numbers. The FORMAT Option The EXPLAIN [ANA ...
https://man.mtool.work/duckdb/2.0/dev/profiling.html
Profiling Queries 10706
DuckDB supports profiling queries via the EXPLAIN and EXPLAIN ANALYZE statements. EXPLAIN To see the query plan of a query without executing it, run: EXPLAIN ⟨query⟩; The output of EXPLAIN contains the estimated cardinalities for each opera ... tor. EXPLAIN (SQL) New As of DuckDB 2.0, EXPLAIN (SQL) renders the optimized logical plan back as an executable DuckDB SQL string instead of as a plan tree: sql EXPLAIN (SQL) SELECT 1 + 2 AS answer; explain_key e ... xplain_value sql SELECT CAST(3 AS INTEGER) AS answer Because the output is the optimized plan, it can differ substantially from the input query (for example through join reordering, constant folding, or subquery intr ...
https://man.mtool.work/duckdb/2.0/sql/statements/profiling.html
Unity Catalog Extension 9666
The unity_catalog extension attaches a Unity Catalog catalog, on Databricks or Unity Catalog OSS, as a DuckDB database. You can list, read, insert into and create its Delta Lake tables. It uses the delta extension to access the tables. For ... e server for the workspace's default namespace. READ_ONLY BOOLEAN false Attach the catalog in read-only mode. USE_IRC_SCAN_PLAN BOOLEAN false Plan scans on the server (Databricks only); see Server-Side Scan Planning . Reading Tables are named ⟨catalo ... hema.my_table'); The CHECKPOINT statement does not apply to Unity Catalog tables and fails with an error. Server-Side Scan Planning New This feature was introduced in DuckDB 2.0. Databricks can plan scans on the server, through the Iceberg REST Catal ... filtering and reduce the number of files that a query scans. Unity Catalog OSS does not offer this API. With USE_IRC_SCAN_PLAN true , DuckDB sends each scan's filters to the server and reads only the files that it returns, with their delete files. D ...
https://man.mtool.work/duckdb/2.0/core_extensions/unity_catalog.html
Overview of DuckDB Internals 9503
Tip For a detailed explanation of DuckDB internals, see the Design and Implementation of DuckDB Internals ("DiDi") library entry. On this page is a brief description of the internals of the DuckDB engine. Parser The parser converts a query ... : SQLStatement → BoundStatement QueryNode → BoundQueryNode TableRef → BoundStatement ParsedExpression → Expression Logical Planner The logical planner creates LogicalOperator nodes from the bound statements. In this phase, the actual logical query tr ... ee is created. Optimizer After the logical planner has created the logical query tree, the optimizers are run over that query tree to create an optimized query plan. The ... pression Rewriter : Simplifies expressions, performs constant folding Filter Pushdown : Pushes filters down into the query plan and duplicates filters over equivalency sets. Also prunes subtrees that are guaranteed to be empty (because of filters tha ...
https://man.mtool.work/duckdb/2.0/internals/overview.html
SQL to/from JSON 9422
DuckDB provides functions to serialize and deserialize SELECT statements between SQL and JSON, as well as executing JSON serialized statements. Function Type Description json_deserialize_sql(json) Scalar Deserialize one or many json seriali ... son serialized statements and return the resulting rows. Only one statement at a time is supported for now. json_serialize_plan(varchar, skip_default := boolean, format := boolean, optimize := boolean) Scalar Serialize the bound logical query plan of ... a set of semicolon-separated ( ; ) statements to JSON. If optimize is true , the optimized plan is serialized. json_serialize_sql(varchar, skip_default := boolean, skip_empty := boolean, skip_null := boolean, format := ... NOT VALID SQL')); Parser Error: Error parsing json: parser: syntax error at or near "VALID" Serializing the bound logical plan of a statement with json_serialize_plan : SELECT json_serialize_plan('SELECT 1 + 2', format := true); { "error": false, "p ...
https://man.mtool.work/duckdb/2.0/data/json/sql_to_and_from_json.html
Pragmas 8772
The PRAGMA statement is a SQL extension adopted by DuckDB from SQLite. PRAGMA statements can be issued in a similar manner to regular SQL statements. PRAGMA commands may alter the internal state of the database engine, and can influence the ... r; Or: PRAGMA disable_print_progress_bar; EXPLAIN Output The output of EXPLAIN can be configured to show only the physical plan. The default configuration of EXPLAIN : SET explain_output = 'physical_only'; To only show the optimized query plan: SET e ... xplain_output = 'optimized_only'; To show all query plans: SET explain_output = 'all'; Profiling Enable Profiling The following query enables profiling with the default format, qu ... Coverage By default, the profiling coverage is set to SELECT . SELECT runs the profiler for each operator in the physical plan of a SELECT statement. SET profiling_coverage = 'SELECT'; By default, the profiler does not emit profiling information for ...
https://man.mtool.work/duckdb/2.0/configuration/pragmas.html
Iceberg Functions 8285
The iceberg extension provides the following functions: Function Description iceberg_scan(source) Reads an Iceberg table from a path. iceberg_metadata(source) Returns the manifest entries of an Iceberg table. iceberg_snapshots(source) Retur ... nd tags of an Iceberg table. iceberg_partition_specs(source) Returns the partition specs of an Iceberg table. iceberg_scan_plan(table) Returns the scan tasks (files to read) planned for an Iceberg table. iceberg_view_metadata(view) Returns the raw Lo ... ytes FROM iceberg_files(my_datalake.default.t); SELECT * FROM iceberg_partition_specs(my_datalake.default.t); iceberg_scan_plan The iceberg_scan_plan(table) function is an advanced function that returns the scan tasks DuckDB would read for a table, i ... can. produce_sequence_number BOOLEAN Include the data sequence number of each file in the output. snapshot_from_id UBIGINT Plan the scan for the snapshot with the given ID. snapshot_from_timestamp TIMESTAMP_MS Plan the scan for the snapshot that was ...
https://man.mtool.work/duckdb/2.0/core_extensions/iceberg/iceberg_functions.html
Integration with Polars 8123
Polars is a DataFrames library built in Rust with bindings for Python and Node.js. It uses Apache Arrow's columnar format as its memory model. DuckDB can read Polars DataFrames and convert query results to Polars DataFrames. It does this in ... LECT 1 AS id, 'banana' AS fruit UNION ALL SELECT 2, 'apple' UNION ALL SELECT 3, 'mango'""" ).pl(lazy=True) print(df) naive plan: (run LazyFrame.explain(optimized=True) to see the optimized plan) PYTHON SCAN [] PROJECT */2 COLUMNS A relation also impl ...
https://man.mtool.work/duckdb/2.0/guides/python/polars.html
PREV 1 2 3 NEXT
DuckDB 2.0 Documentation / man.mtool.work