⌘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 13 for loop (0.002 sec.)
INSERT Statements 13161
INSERT statements are the standard way of loading data into a relational database. When using INSERT statements, the values are supplied row-by-row. While simple, there is significant overhead involved in parsing and processing individual I ... ividual row-by-row INSERT statements when inserting more than a few rows (i.e., avoid using INSERT statements as part of a loop). When bulk inserting data, try to maximize the amount of data that is inserted per statement. If you must use INSERT stat ... ements to load data in a loop, avoid executing the statements in auto-commit mode. After every commit, the database is required to sync the changes made ... ary when bulk loading and will significantly slow down your program. Tip If you absolutely must use INSERT statements in a loop to load data, wrap them in calls to BEGIN TRANSACTION and COMMIT . Syntax An example of using INSERT INTO to load data in ...
https://man.mtool.work/duckdb/2.0/data/insert.html
Loops 11613
Loops can be used in sqllogictests when it is required to execute the same query many times but with slight modifications in constant values. For example, suppose we want to fire off 100 queries that check for the presence of the values 0.. ... ment ok CREATE TABLE integers AS SELECT * FROM range(0, 100, 1) t1(i); # verify individually that all 100 values are there loop i 0 100 # execute the query, replacing the value query I SELECT count(*) FROM integers WHERE i = ${i}; ---- 1 # end the lo ... op (note that multiple statements can be part of a loop) endloop Similarly, foreach can be used to iterate over a set of values. foreach partcode millennium century decade year q ... date_part('${partcode}', i) AS p, date_part(['${partcode}'], i) AS st FROM intervals WHERE p <> st['${partcode}']; ---- endloop foreach also has a number of preset combinations that should be used when required. In this manner, when new combinations ...
https://man.mtool.work/duckdb/2.0/dev/sqllogictest/loops.html
Integration with PyTorch 10240
PyTorch tensors can be built from DuckDB query results by exporting each result batch as Apache Arrow . This pattern is useful when training or serving models on Parquet data because DuckDB can filter and project the input before the batche ... r method of a relation streams the result in batches instead of materializing the full result in memory at once. While the loop holds the reader, other queries on con raise a ResourceInUseException ; a loop that runs a query per batch needs a cursor ...
https://man.mtool.work/duckdb/2.0/guides/python/pytorch.html
Run Queries 8885
Overview Because the Go client implements database/sql , queries run through the standard methods: Exec and ExecContext send statements that do not return rows, such as INSERT or DDL, and report the number of affected rows. Query , QueryCon ... s. Prepared Statements db.PrepareContext() compiles a statement once so it can be executed many times, which pays off in a loop. The returned *sql.Stmt has its own Exec and Query methods, and must be closed when no longer needed: stmt, err := db.Prep ... rsor. Advance it with Next() , read the current row's columns into pointers with Scan() , and always check Err() after the loop and close the cursor. Scan matches columns to the destination Go types by position: rows, err := db.QueryContext(ctx, `SEL ...
https://man.mtool.work/duckdb/2.0/clients/go/querying.html
Configuration 8885
DuckDB has a number of configuration options that can be used to change the behavior of the system. The configuration options can be set using either the SET statement or the PRAGMA statement . They can be reset to their original values usi ... lse arrow_output_version Whether strings should be produced by DuckDB in Utf8View format instead of Utf8. VARCHAR 1.0 asof_loop_join_threshold The maximum number of rows we need on the left side of an ASOF join to use a nested loop join. UBIGINT 64 a ... s BOOLEAN true merge_join_threshold The maximum number of rows on either table to choose a merge join. UBIGINT 1000 nested_loop_join_threshold The maximum number of rows on either table to choose a nested loop join. UBIGINT 5 order_by_non_integer_lit ...
https://man.mtool.work/duckdb/2.0/configuration/overview.html
Configuration 8199
Configuration options can be provided to change different settings of the database system. Note that many of these settings can be changed later on using PRAGMA statements as well. The configuration object should be created, filled with val ... the total amount of configuration options available for usage with duckdb_get_config_flag . This should not be called in a loop as it internally loops over all the options. Return Value The amount of config options available. Syntax size_t duckdb_con ...
https://man.mtool.work/duckdb/2.0/clients/c/config.html
FROM and JOIN Clauses 8199
The FROM clause specifies the source of the data on which the remainder of the query should operate. Logically, the FROM clause is where the query starts execution. The FROM clause can contain a single table, a combination of multiple table ... AL (SELECT i + 10 UNION ALL SELECT i + 100) t2(j); i j 0 10 1 11 0 100 1 101 It may be helpful to think about LATERAL as a loop where we iterate through the rows of the first subquery and use it as input to the second ( LATERAL ) subquery. In the exa ... may have a natural correspondence based on their physical order. In scripting languages, this is easily expressed using a loop: for (i = 0; i < n; i++) { f(t1.a[i], t2.b[i]); } It is difficult to express this in standard SQL because relational table ...
https://man.mtool.work/duckdb/2.0/sql/query_syntax/from.html
Migrating Python Code to DuckDB 2.0 7847
This page lists what Python code written for DuckDB 1.x must change to run on DuckDB 2.0. Each item gives the 1.x form, the 2.0 form and the page that explains it. For changes outside the Python client, see Migrating to DuckDB v2.0 . Python ... cause a relation keeps no result between calls and runs its query again on every read. To keep a fetchone() or fetchmany() loop for a SQL query, create its result with con.execute(query) instead of con.sql(query) . To iterate over an existing relatio ...
https://man.mtool.work/duckdb/2.0/clients/python/migration.html
Unit Tester Configuration 7847
There are three ways of setting options for the unit tester: Command Line Arguments Configuration File Environment Variables Configuration Options List See the Configuration Options List for the full list of available options. Command Line ... the sandboxed temp-dir home --max-test-threads <num> Max threads to be used by the test runner itself (for e.g. concurrent loop) --max-threads <num> Max threads to use during tests --on-cleanup <string> SQL statements to execute on test end --on-init ...
https://man.mtool.work/duckdb/2.0/dev/sqllogictest/test_configuration.html
Tuning Workloads 7689
DuckDB aims to perform well out of the box, so most workloads do not require any tuning. When tuning is worthwhile, there is no single configuration or magic number that is optimal for every workload: the right settings depend on what you a ... tal query processing time. Query plans can point to the root of performance issues. A few general directions: Avoid nested loop joins in favor of hash joins. A scan that does not include a filter pushdown for a filter condition that is later applied ...
https://man.mtool.work/duckdb/2.0/guides/performance/how_to_tune_workloads.html
PREV 1 2 NEXT
DuckDB 2.0 Documentation / man.mtool.work