Styxis
Company
Knowledge

Test ClickHouse result limits against queries without FROM

Compare actual result rows with the approved cap even when a query omits FROM. This delivery check detects oversized results but cannot undo resources already consumed or replace server-side enforcement.

Profile existence differs from output

An existing settings profile does not establish a result-consumption boundary for every query shape. Truthound Core can check an observed row count against the approved cap after execution, while server-side enforcement remains a separate control. [1, 2, 3]

A FROM-free result-limit report

ClickHouse issue #129393 reports max_result_rows=100000 allowing 1000000 rows for arrayJoin without FROM or with system.one on 24.8.14.39 and 25.8.33.6. A subquery or numbers(1) control fails with error 396 as expected in the report. [1]

Record the query shape

Record query shape, effective limit, output rows, and delivery approval. Compare FROM-free, system.one, and subquery controls. Do not hand an oversized result to a dashboard merely because the user is read-only. [1, 3]

The 100000-row consumer cap

Declare a consumer cap of 100000 rows. The illustrative normal result of 100000 satisfies observed<=cap. A result of 1000000 fails. The threshold is this consumer policy, not a universal safe output size. [1, 3]

A late check cannot prevent prior cost

ColumnPairValidator in Truthound Core Python SDK 3.3.2 can compare prepared non-null observed_rows<=approved_cap. The operator supplies the cap and actual count. A post-execution check cannot prevent resource use already incurred, and the SDK does not enforce server profiles or guarantee memory safety. [1, 2, 3]

Verify the service boundary

Validate query forms where output enforcement actually occurs and apply a separately verified service boundary. Retain the source query so a syntactic control is not mistaken for evidence about a different form. [1, 3]

Keep the delivery claim bounded

Treat the check as a delivery gate with a bounded claim. It identifies an oversized result; it does not certify access control, query cost, or protection against every server resource path. [1, 3]

Application conditions

Keep actual rows and the approved cap with each query shape’s execution record.

Alternatives

Verify query and service boundaries that actually enforce result limits.

Limitations

  • A post-execution delivery check cannot prevent server resources already consumed.

Evidence

Event checked
Subject checked
Modified