v25.12 Changelog for Cloud

### Aggregation optimizations[​](#aggregation-optimizations "Direct link to Aggregation optimizations")

- Optimize `AggregateFunctionHistogram` by sorting only the tail of points array and skipping sort for monotonic inputs, achieving ~10% speedup. [#85760](https://github.com/ClickHouse/ClickHouse/pull/85760) ([MakarDev](https://github.com/MakarDev)).
- Slightly speed up some countDistinct operations by reducing the overhead of HashSetTable::merge. [#89727](https://github.com/ClickHouse/ClickHouse/pull/89727) ([Raúl Marín](https://github.com/Algunenano)).
- Improve topK performance and behaviour. [#90091](https://github.com/ClickHouse/ClickHouse/pull/90091) ([Raúl Marín](https://github.com/Algunenano)).
- Improved performance of Decimal comparison operations. Resolves [#28192](https://github.com/ClickHouse/ClickHouse/issues/28192). [#90153](https://github.com/ClickHouse/ClickHouse/pull/90153) ([Konstantin Bogdanov](https://github.com/thevar1able)).

### S3 and backup optimizations[​](#s3-and-backup-optimizations "Direct link to S3 and backup optimizations")

- S3 partitions objects internally based on key-name prefixes and automatically scales to high request rates per partition. This change introduces two new BACKUP settings: data\_file\_name\_generator and data\_file\_name\_prefix\_length. When data\_file\_name\_generator=checksum, backup data files are named using a hash of their contents. [#88418](https://github.com/ClickHouse/ClickHouse/pull/88418) ([Julia Kartseva](https://github.com/jkartseva)).
- Improve query performance for S3 tables created with glob pattern by pushing down `_path` filter values, which allows to avoid S3 listing operations. Controlled by the `s3_path_filter_limit` setting. [#91165](https://github.com/ClickHouse/ClickHouse/pull/91165) ([Eduard Karacharov](https://github.com/korowa)).

### Data lake optimizations[​](#data-lake-optimizations "Direct link to Data lake optimizations")

- Distributed execution: better split tasks by row groups IDs, not by files. [#87508](https://github.com/ClickHouse/ClickHouse/pull/87508) ([Konstantin Vedernikov](https://github.com/scanhex12)).
- Support partition pruning for Paimon functions. [#90253](https://github.com/ClickHouse/ClickHouse/pull/90253) ([JIaQi Tang](https://github.com/JiaQiTang98)).

## Improvements[​](#improvements "Direct link to Improvements")

### Query optimization and execution[​](#query-optimization-and-execution "Direct link to Query optimization and execution")

- Allow `FETCH PARTITION` when there are broken disks in replicated merge tree tables. [#58663](https://github.com/ClickHouse/ClickHouse/pull/58663) ([Duc Canh Le](https://github.com/canhld94)).
- Add `h3PolygonToCells` function which can fill geometry with h3 hexagons. Resolves [#33991](https://github.com/ClickHouse/ClickHouse/issues/33991). [#66262](https://github.com/ClickHouse/ClickHouse/pull/66262) ([Zacharias Knudsen](https://github.com/zachasme)).
- All DDL `ON CLUSTER` queries now execute with the original query user context for better access validation. [#71334](https://github.com/ClickHouse/ClickHouse/pull/71334) ([pufit](https://github.com/pufit)).
- Added parallelism for `ALTER TABLE ... FREEZE` queries. [#71743](https://github.com/ClickHouse/ClickHouse/pull/71743) ([Kirill](https://github.com/kirillgarbar)).
- Allows the use of non-constant second arguments for `IN`. It also supports a tuple as a second argument. [#77906](https://github.com/ClickHouse/ClickHouse/pull/77906) ([Yarik Briukhovetskyi](https://github.com/yariks5s)).
- This PR allows using normal projections as a secondary index. When enabled, certain query predicates can be used to read from projection parts and generate bitmaps to filter rows efficiently during the PREWHERE stage. [#81021](https://github.com/ClickHouse/ClickHouse/pull/81021) ([Amos Bird](https://github.com/amosbird)).
- Enable `enable_shared_storage_snapshot_in_query` by default for better consistency guarantees. [#82634](https://github.com/ClickHouse/ClickHouse/pull/82634) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
- UNION should unify types with Variant if needed. Resolves [#82772](https://github.com/ClickHouse/ClickHouse/issues/82772). [#83246](https://github.com/ClickHouse/ClickHouse/pull/83246) ([Mithun p](https://github.com/mithunputhusseri)).
- Log internal queries (those executed internally by dictionaries, refreshable materialized views, etc) and add the new `is_internal` column to `system.query_log`. [#83277](https://github.com/ClickHouse/ClickHouse/pull/83277) ([Miсhael Stetsyuk](https://github.com/mstetsyuk)).
- Allows `INSERT` into `ALIAS` columns (columns that simply refers to a physical column without any expression). Closes [#80060](https://github.com/ClickHouse/ClickHouse/issues/80060). [#84154](https://github.com/ClickHouse/ClickHouse/pull/84154) ([Shaurya Mohan](https://github.com/ShauryaMohan)).
- You can see a progress bar, logs and performance statistics for `CREATE OR REPLACE TABLE` queries with `SELECT` in clickhouse-client. Resolves [#38416](https://github.com/ClickHouse/ClickHouse/issues/38416). [#87247](https://github.com/ClickHouse/ClickHouse/pull/87247) ([Diskein](https://github.com/Diskein)).
- Support JSON and Dynamic types in hash functions. Resolves [#87734](https://github.com/ClickHouse/ClickHouse/issues/87734). [#87791](https://github.com/ClickHouse/ClickHouse/pull/87791) ([Pavel Kruglov](https://github.com/Avogar)).
- The default value of `query_plan_optimize_join_order_limit` is changed to 10. [#89312](https://github.com/ClickHouse/ClickHouse/pull/89312) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
- The optimization enable\_lazy\_columns\_replication is now the default, which will save memory usage in joins. [#89316](https://github.com/ClickHouse/ClickHouse/pull/89316) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
- Enable the setting `allow_statistics_optimize` by default, so the JOINs optimizer will use column statistics. [#89332](https://github.com/ClickHouse/ClickHouse/pull/89332) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
- Enable `create_table_empty_primary_key_by_default` by default. This is better for usability. [#89333](https://github.com/ClickHouse/ClickHouse/pull/89333) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
- Setting `enable_time_time64_type` is now enabled by default. [#89345](https://github.com/ClickHouse/ClickHouse/pull/89345) ([Yarik Briukhovetskyi](https://github.com/yariks5s)).
- Enable setting `allow_special_serialization_kinds_in_output_formats` by default. [#89402](https://github.com/ClickHouse/ClickHouse/pull/89402) ([Pavel Kruglov](https://github.com/Avogar)).
- Ignore `ON CLUSTER` in queries executed through Shared Catalog. ([Nikolay Degterinsky](https://github.com/evillique)).
- Add support for `ALTER DATABASE MODIFY COMMENT` to Shared Catalog. ([Nikolay Degterinsky](https://github.com/evillique)).
- Support `CREATE OR REPLACE` for SharedSet/SharedJoin in Shared databases. ([Tuan Pham Anh](https://github.com/tuanpach)).
- Avoid waiting for other queries when running `SYNC REPLICA` in SharedMergeTree. ([Raúl Marín](https://github.com/Algunenano)).

### Storage and MergeTree improvements[​](#storage-and-mergetree-improvements "Direct link to Storage and MergeTree improvements")