Results of 1 - 10 of about 260 for query (0.002 sec.)
- Profiling 8358
- 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. T...he EXPLAIN statement shows the query plan and describes what is going on under the hood. The EXPLAIN ANALYZE Statement The query plan helps developers understa...nd the performance characteristics of the query. However, it is often also necessary to examine the performance numbers of individual operators and the cardinalities that... - https://man.mtool.work/duckdb/2.0/dev/profiling.html
- SQL to/from JSON 8071
- 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
...erialize_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. jso...tatements will not be able to see any transaction local changes. This is because the statements are executed in a separate query context. You can use the PRAGMA json_execute_serialized_sql(varchar) pragma version to execute the statements in the same...":"SELECT_NODE","modifiers":[],"cte_map":{"map":[]},"select_list":[{"class":"CONSTANT","type":"VALUE_CONSTANT","alias":"","query_location":7,"query_location_length":1,"literal":{"kind":"INTEGER","text":"2"}}],"from_table":{"type":"EMPTY","alias":"","s... - https://man.mtool.work/duckdb/2.0/data/json/sql_to_and_from_json.html
- ODBC Extension Functions 7992
- odbc_begin_transaction odbc_bind_params odbc_close odbc_commit odbc_connect odbc_copy odbc_create_params odbc_list_data_sources odbc_list_drivers odbc_query odbc_rollback odbc_begin_transaction odbc_begin_transaction(conn_handle BIGINT) ->
...NT Binds specified parameter values to the specified parameters handle. Only necessary with 2-step parameters binding, see Query parameters for details. Parameters: conn_handle ( BIGINT ): ODBC connection handle created with odbc_connect params_handle..., intended for one-off queries, in this case new ODBC connection will be opened and will be closed automatically after the query is complete Optional named parameters (source): Source query is executed using a separate DB instance from the instance on...which odbc_copy is being called. Thus source_query cannot refer to pre-existing in-memory tables and cannot open currently opened DuckDB files. As a workaround, for complex... - https://man.mtool.work/duckdb/2.0/core_extensions/odbc/functions.html
- Result Verification 7962
- The standard way of verifying results of queries is using the query statement, followed by the letter I times the number of columns that are expected in the result. After the query, four dashes ( ---- ) are expected followed by the result v
...alues separated by tabs. For example, query II SELECT 42, 84 UNION ALL SELECT 10, 20; ---- 42 84 10 20 For legacy reasons the letters R and T are also accepted to den...trings Empty lines have special significance for the SQLLogic test runner: they signify an end of the current statement or query. For that reason, empty strings and NULL values have special syntax that must be used in result verification. NULL values...should use the string NULL , and empty strings should use the string (empty) , e.g.: query II SELECT NULL, '' ---- NULL (empty) Error Verification In order to signify that an error is expected, the statement error... - https://man.mtool.work/duckdb/2.0/dev/sqllogictest/result_verification.html
- Metrics 7873
- 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
...acked_metrics setting , which takes a list of glob patterns, e.g., ['query.*', 'operator.timing'] . By default, all metrics are collected ( ['*'] ). The available metrics, along with their types an..._name, metric_type, unit FROM duckdb_available_metrics(); 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 seconds CPU time spent on the query query.sql string The SQL string of the query query.total_intermediate_... - https://man.mtool.work/duckdb/2.0/dev/metrics.html
- Pragmas 7675
- 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
...buffer manager handles the majority of the data processed. However, certain in-memory data structures such as vectors and query results are allocated outside of the buffer manager. Additionally, aggregate functions with complex state (e.g., list , mo...he actual memory consumption can be higher than the specified memory limit. Threads Set the amount of threads for parallel query execution: SET threads = 4; Maximum Execution Time New As of DuckDB 2.0, the max_execution_time setting bounds the wall-cl...ock time of a query in milliseconds. When the limit is exceeded, the query is aborted with the error Query exceeded maximum execution time . T... - https://man.mtool.work/duckdb/2.0/configuration/pragmas.html
- ODBC Extension 7645
- Please note that DuckDB also offers an ODBC client , which allows you to connect to DuckDB via ODBC from other applications. The odbc_scanner extension allows connecting to other databases (using their ODBC drivers ) and run queries with th
...e odbc_query or copy data from DuckDB with the odbc_copy functions. The extension is also available under the alias odbc . Installing a...remote DB SET VARIABLE conn = odbc_connect('Driver={Oracle driver};DBQ=//127.0.0.1:1521/XE', 'scott', 'tiger'); -- simple query FROM odbc_query(getvariable('conn'), 'SELECT SYSTIMESTAMP FROM DUAL'); -- query with parameters FROM odbc_query(getvariabl....org/v1.2.0/⟨platform⟩/odbc_scanner.duckdb_extension.gz'; Installed version (commit ID) can be checked using the following query: FROM duckdb_extensions() WHERE extension_name = 'odbc_scanner'; To install a version built from a specific commit run: FO... - https://man.mtool.work/duckdb/2.0/core_extensions/odbc/overview.html
- Profile and Monitor 7615
- Overview The Rust client can observe a running or completed query: it can retrieve per-operator profiling metrics after a query runs, and interrupt a long-running query from another thread. Both are shown below. Profiling Profiling must be
...enabled on a connection before metrics are collected. Enable it with the enable_profiling PRAGMA , run a query, then read the result with get_profiling_info() : use duckdb::Connection; let conn = Connection::open_in_memory()?; // Do...not print profiling output to stdout after each query (the default when profiling is enabled). conn.execute("PRAGMA enable_profiling = 'no_output'", [])?; conn.execute("SELECT...t plan operator, with metrics such as type , timing and intermediate_rows , followed by one node per metric group, such as query with total_time . Read a node's metrics through its metrics map and its children through children . Interrupting Queries A... - https://man.mtool.work/duckdb/2.0/clients/rust/profiling.html
- Run Queries 7566
- Overview DuckDB-Wasm provides functions for querying data. Queries are run sequentially: First, create a connection by calling connect . Then, run queries by calling query to materialize the whole result, or send to fetch result chunks lazi
...ly. This page covers running queries, prepared statements, converting results to JSON, and exporting to Parquet. Query Execution Use query() when you want the entire result at once, or send() to iterate over Apache Arrow record batches as th...eam than hold in memory all at once: // Create a new connection const conn = await db.connect(); // Either materialize the query result await conn.query<{ v: arrow.Int }>(` SELECT * FROM generate_series(1, 100) t(v) `); // ..., or fetch the result chu..... } // Close the connection to release memory await conn.close(); Prepared Statements Prepared statements let you parse a query once and run it repeatedly with different parameter values, binding each value in place of a ? placeholder. Both query() (... - https://man.mtool.work/duckdb/2.0/clients/wasm/query.html
- Query 7477
- The duckdb_query method allows SQL queries to be run in DuckDB from C. This method takes two parameters, a (null-terminated) SQL query string and a duckdb_result result pointer. The result pointer may be NULL if the application is not inter
...ested in the result set or if the query produces no result. After the result is consumed, the duckdb_destroy_result method should be used to clean up the result....names and types of individual columns. Example duckdb_state state; duckdb_result result; // create a table state = duckdb_query(con, "CREATE TABLE integers (i INTEGER, j INTEGER);", NULL); if (state == DuckDBError) { // handle error } // insert three...rows into the table state = duckdb_query(con, "INSERT INTO integers VALUES (3, 4), (5, 6), (7, NULL);", NULL); if (state == DuckDBError) { // handle error } // que... - https://man.mtool.work/duckdb/2.0/clients/c/query.html
DuckDB 2.0 Documentation / man.mtool.work