Results of 1 - 10 of about 17 for sorting (0.002 sec.)
- ORDER BY Clause 13242
- ORDER BY is an output modifier. Logically it is applied near the very end of the query (just prior to LIMIT or OFFSET , if present). The ORDER BY clause sorts the rows on the sorting criteria in either ascending or descending order. In addi
...rder can be changed with the following configuration options. Use the default_null_order option to change the default NULL sorting order to either NULLS_FIRST , NULLS_LAST , NULLS_FIRST_ON_ASC_LAST_ON_DESC or NULLS_LAST_ON_ASC_FIRST_ON_DESC : SET defaul...t_null_order = 'NULLS_FIRST'; Use the default_order option to change the direction of the default sorting order to either DESC or ASC : SET default_order = 'DESC'; Collations Text is sorted using the binary comparison collation...alues are sorted on their binary UTF-8 values. While this works well for ASCII text (e.g., for English language data), the sorting order can be incorrect for other languages. For this purpose, DuckDB provides collations. For more information on collatio... - https://man.mtool.work/duckdb/2.0/sql/query_syntax/orderby.html
- List Functions 11742
- Function Description list[index] Extracts a single list element using a (1-based) index . list[begin[:end][:step]] Extracts a sublist using slice conventions . Negative values are accepted. list1 && list2 Alias for list_has_any . list1 <->
...reverse(list) Reverses the list . list_reverse_sort(list[, col1]) Sorts the elements of the list in reverse order. See the Sorting Lists section for more details about sorting order and NULL values. list_select(value_list, index_list) Returns a list bas...in, end, step) list_slice with added step feature. list_sort(list[, col1][, col2]) Sorts the elements of the list. See the Sorting Lists section for more details about sorting order and NULL values. list_stddev_pop(list) Applies aggregate function stdde...| array_reverse | list_reverse_sort(list[, col1]) | Description | Sorts the elements of the list in reverse order. See the Sorting Lists section for more details about sorting order and NULL values. | | Example | list_reverse_sort([3, 6, 1, 2]) | | Resu... - https://man.mtool.work/duckdb/2.0/sql/functions/list.html
- Result Verification 10897
- 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
...t_result can be used to force the program to print the result to the terminal for every query run in the test file. Result Sorting Queries can have an optional field that indicates that the result should be sorted in a specific manner. This field goes i...n the same location as the connection label. Because of that, connection labels and result sorting cannot be mixed. The possible values of this field are nosort , rowsort and valuesort . An example of how this might be us...queries that are logically equivalent, but formulated differently. Query labels are provided after the connection label or sorting specifier. Queries that have a query label do not need to have a result provided. Instead, the results of each of the quer... - https://man.mtool.work/duckdb/2.0/dev/sqllogictest/result_verification.html
- Parquet Tips 10035
- Below is a collection of tips to help when dealing with Parquet files. Tips for Reading Parquet Files Use union_by_name When Loading Files with Different Schemas The union_by_name option can be used to unify the schema of files that have di
...ILE_SIZE_BYTES . However, if PER_THREAD_OUTPUT is set, only one thread writes to each file, and it becomes accurate again. Sorting Rows to Improve Row Group Pruning DuckDB writes per-column statistics, including min/max values, for every row group, and...as described above the reader uses these to skip row groups that cannot match a query's WHERE clause. Sorting the data on the columns that you filter on most often before writing makes these min/max ranges tight and non-overlapping... - https://man.mtool.work/duckdb/2.0/data/parquet/tips.html
- Tuning Workloads 8535
- 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
...operators in relational database systems. The main blocking operators are the following: grouping: GROUP BY joining: JOIN sorting: ORDER BY windowing: OVER ... (PARTITION BY ... ORDER BY ...) DuckDB supports larger-than-memory processing for all of the...erators. Some aggregate functions , such as string_agg() , do not support offloading to disk. Aggregate functions that use sorting are holistic, i.e., they need all inputs before the aggregation can start. As DuckDB cannot yet offload some complex inter... - https://man.mtool.work/duckdb/2.0/guides/performance/how_to_tune_workloads.html
- Partitioned Writes 7897
- Examples Write a table to a Hive partitioned dataset of Parquet files: COPY orders TO 'orders' (FORMAT parquet, PARTITION_BY (year, month)); Write a table to a Hive partitioned dataset of CSV files, allowing overwrites: COPY orders TO 'orde
...ts arguments with the platform path separator: sql SELECT path_join('dir', 'subdir', 'file.txt'); text dir/subdir/file.txt Sorting Rows Within Partitions New As of DuckDB 2.0, the ORDER_BY copy option sorts the rows before they are written. When combine... - https://man.mtool.work/duckdb/2.0/data/partitioning/partitioned_writes.html
- Environment 7897
- The environment where DuckDB is run has an obvious impact on performance. This page focuses on the effects of the hardware configuration and the operating system used. Hardware Configuration CPU DuckDB's officially supported architectures a
...ss larger-than-memory workloads by spilling to disk. This is possible thanks to out-of-core support for grouping, joining, sorting and windowing operators. Note that larger-than-memory workloads can be processed both in persistent mode and in in-memory... - https://man.mtool.work/duckdb/2.0/guides/performance/environment.html
- Indexing 7897
- DuckDB has two types of indexes: zonemaps and ART indexes. Zonemaps DuckDB automatically creates zonemaps (also known as min-max indexes) for the columns of all general-purpose data types . Operations like predicate pushdown into scan opera
...highly selective queries using the indexed column. An ART index does not affect the performance of join, aggregation, and sorting queries. ART Index Scans ART index scans probe a single-column ART index for the requested data instead of scanning a tabl... - https://man.mtool.work/duckdb/2.0/guides/performance/indexing.html
- Schema 7897
- Types It is important to use the correct type for encoding columns (e.g., BIGINT , DATE , DATETIME ). While it is always possible to use string types ( VARCHAR , etc.) to encode more specific values, this is not recommended. Strings use mor
...hieves a similar effect automatically.) First, build a dimension table that assigns an integer key to each distinct value. Sorting the values keeps the keys stable and improves compression: CREATE OR REPLACE TABLE dim_table AS SELECT field_name, (row_nu... - https://man.mtool.work/duckdb/2.0/guides/performance/schema.html
- Union Type 7897
- A UNION type (not to be confused with the SQL UNION operator ) is a nested type capable of holding one of multiple “alternative” values, much like the union in C. The main difference is that these UNION types are tagged unions and thus alwa
..., b B) ❌ UNION(a A, b B) UNION(a A, b C) if B can't be implicitly cast to C ❌ UNION(A, B, D) UNION(A, B, C) Comparison and Sorting Since UNION types are implemented on top of STRUCT types internally, they can be used with all the comparison operators as... - https://man.mtool.work/duckdb/2.0/sql/data_types/union.html
DuckDB 2.0 Documentation / man.mtool.work