@@ -1642,6 +1642,34 @@ const EnvironmentSchema = z
16421642 CLICKHOUSE_LOGS_LIST_MAX_THREADS : z . coerce . number ( ) . int ( ) . default ( 2 ) ,
16431643 CLICKHOUSE_LOGS_LIST_MAX_ROWS_TO_READ : z . coerce . number ( ) . int ( ) . default ( 10_000_000 ) ,
16441644 CLICKHOUSE_LOGS_LIST_MAX_EXECUTION_TIME : z . coerce . number ( ) . int ( ) . default ( 120 ) ,
1645+ // Bound read-in-order memory on object-storage reads: each part opens a per-column read
1646+ // stream, and the default ~1 MiB+ S3 buffers dominate peak memory. These two byte sizes
1647+ // cap the per-stream buffers and exist on every supported ClickHouse, so they are always on.
1648+ CLICKHOUSE_LOGS_LIST_PREFETCH_BUFFER_SIZE : z . coerce . number ( ) . int ( ) . nonnegative ( ) . default ( 262_144 ) ,
1649+ CLICKHOUSE_LOGS_LIST_MAX_READ_BUFFER_SIZE : z . coerce . number ( ) . int ( ) . nonnegative ( ) . default ( 262_144 ) ,
1650+ // The decisive lever on Cloud SharedMergeTree, but it only exists on newer ClickHouse and
1651+ // is a no-op on local-disk MergeTree, so it is opt-in: unset means it is never sent (safe on
1652+ // any self-hosted version). Set to 0 on object-storage deployments to get the memory win.
1653+ CLICKHOUSE_LOGS_LIST_FILESYSTEM_CACHE_PREFER_BIGGER_BUFFER_SIZE : z . coerce
1654+ . number ( )
1655+ . int ( )
1656+ . nonnegative ( )
1657+ . optional ( ) ,
1658+
1659+ // Logs list pagination tuning (page sizing + recent-first probe windows).
1660+ LOGS_LIST_DEFAULT_PAGE_SIZE : z . coerce . number ( ) . int ( ) . positive ( ) . default ( 50 ) ,
1661+ LOGS_LIST_MAX_PAGE_SIZE : z . coerce . number ( ) . int ( ) . positive ( ) . default ( 100 ) ,
1662+ // Days back from the page ceiling to probe before widening to the full requested window,
1663+ // comma-separated. Empty disables narrowing (a single full-window query).
1664+ LOGS_LIST_RECENT_FIRST_PROBE_DAYS : z
1665+ . string ( )
1666+ . default ( "1,7" )
1667+ . transform ( ( s ) =>
1668+ s
1669+ . split ( "," )
1670+ . map ( ( v ) => Number ( v . trim ( ) ) )
1671+ . filter ( ( n ) => Number . isFinite ( n ) && n > 0 )
1672+ ) ,
16451673
16461674 // Query feature flag
16471675 QUERY_FEATURE_ENABLED : z . string ( ) . default ( "1" ) ,
0 commit comments