Skip to content

performance: hits dataset performance degradation in new expression #9483

@BohuTANG

Description

@BohuTANG

Summary

The hits table is created and loaded data with the nightly-v0.8.177:

The benchmark with the same settings:

mysql> show settings like '%max%';
+------------------------------------+-------------+-------------+---------+-------------------------------------------------------------------------------------------------------------------+--------+
| name                               | value       | default     | level   | description                                                                                                       | type   |
+------------------------------------+-------------+-------------+---------+-------------------------------------------------------------------------------------------------------------------+--------+
| max_block_size                     | 65536       | 65536       | SESSION | Maximum block size for reading, default value: 65536.                                                             | UInt64 |
| max_execute_time                   | 0           | 0           | SESSION | The maximum query execution time. it means no limit if the value is zero. default value: 0.                       | UInt64 |
| max_inlist_to_or                   | 3           | 3           | SESSION | Max size in inlist expression that will convert to or combinator, default value: 3.                               | UInt64 |
| max_memory_usage                   | 26604358860 | 26604358860 | SESSION | The maximum memory usage for processing single query, in bytes. By default the value is determined automatically. | UInt64 |
| max_result_rows                    | 0           | 0           | SESSION | Auto limit max result rows if user not specify the limit, default is 0 means no limit                             | UInt64 |
| max_storage_io_requests            | 64          | 64          | SESSION | The maximum number of concurrent IO requests. By default the value is determined automatically.                   | UInt64 |
| max_threads                        | 32          | 32          | SESSION | The maximum number of threads to execute the request. By default the value is determined automatically.           | UInt64 |
| storage_io_max_page_bytes_for_read | 524288      | 524288      | SESSION | The maximum bytes of one IO request to read. Default the value is 512KB                                           | UInt64 |
+------------------------------------+-------------+-------------+---------+-------------------------------------------------------------------------------------------------------------------+--------+

Bench(3rd(Hot), chart generated by google sheet):

Update(After #9500 merged)
image

bench script:

cat run-expr.sh
#!/bin/bash

TRIES=3
QUERY_NUM=1

header="| query  | 1st(Cold) | 2nd(Hot) | 3rd(Hot) |\n| ------- | ------- | ------- | ------- |\n";
printf "$header"
cat queries.sql | while read query; do
    echo -n "| q${QUERY_NUM} | "
    for i in $(seq 1 $TRIES); do
        RES=$(curl -w 'Time: %{time_total}\n' http://default@localhost:8124?database=hits -d "${query}" 2>&1 | grep -P '^Time: ' | sed 's/Time: //')
        [[ "$?" == "0" ]] && echo -n "${RES}" || echo -n "null"
        [[ "$i" != $TRIES ]] && echo -n " | "

        echo "${QUERY_NUM},${i},${RES}" >> result.csv
    done
    echo "|"

    QUERY_NUM=$((QUERY_NUM + 1))
done

queries.sql is: https://github.com/ClickHouse/ClickBench/blob/main/databend/queries.sql

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions