Skip to content

Include rows_before_limit_at_least in X-ClickHouse-Summary header #101260

@abonander

Description

@abonander

Company or project name

No response

Use case

ClickHouse/clickhouse-rs#398

The JSON output format includes a bespoke field called rows_before_limit_at_least:

The lower estimate of the number of rows there would have been without LIMIT. Output only if the query contains LIMIT. This estimate is calculated from the blocks of data processed in the query pipeline before the limit transform, but could then be discarded by the limit transform. If the blocks didn't even reach the limit transform in the query pipeline, they don't participate in the estimation.

OP of the above issue, created for the Rust client, would like this added to the X-ClickHouse-Summary header when querying the HTTP interface, as this field is not otherwise included in a RowBinary/RowBinaryWithNamesAndTypes format response but is potentially useful to track to find candidate queries for optimization.

Describe the solution you'd like

Add rows_before_limit_at_least to the X-ClickHouse-Summary header returned from the HTTP interface, where applicable.

We can then expose this field as part of or in extension to ClickHouse/clickhouse-rs#397

Describe alternatives you've considered

No response

Additional context

cc @alrevuelta

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions