> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-mintlify-3a82795f.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> Оценивает коэффициент сжатия указанного столбца без его фактического сжатия.

# estimateCompressionRatio

<div id="estimateCompressionRatio">
  ## estimateCompressionRatio
</div>

Добавленный в: v25.4.0

Оценивает коэффициент сжатия заданного столбца без выполнения сжатия.

<Note>
  В приведённых ниже примерах результат будет различаться в зависимости от кодека сжатия, используемого на сервере по умолчанию.
  См. [Кодеки сжатия столбцов](/ru/reference/statements/create/table#column_compression_codec).
</Note>

**Синтаксис**

```sql theme={null}
estimateCompressionRatio([codec, block_size_bytes])(column)
```

**Параметры**

* `codec` — Строка, содержащая кодек сжатия или несколько кодеков, разделённых запятыми. [`String`](/ru/reference/data-types/string)
* `block_size_bytes` — Размер блока сжатых данных. Это аналогично одновременной установке [`max_compress_block_size`](/ru/reference/settings/merge-tree-settings#max_compress_block_size) и [`min_compress_block_size`](/ru/reference/settings/merge-tree-settings#min_compress_block_size). Значение по умолчанию — 1 MiB (1048576 байт). Максимально допустимое значение — 256 MiB (268435456 байт). [`UInt64`](/ru/reference/data-types/int-uint)

**Аргументы**

* `column` — Столбец любого типа. [`Any`](/ru/reference/data-types)

**Возвращаемое значение**

Возвращает оценку коэффициента сжатия для указанного столбца. [`Float64`](/ru/reference/data-types/float)

**Примеры**

**Базовое использование с кодеком по умолчанию**

```sql title=Query theme={null}
CREATE TABLE compression_estimate_example
(
    `number` UInt64
)
ENGINE = MergeTree()
ORDER BY number
SETTINGS min_bytes_for_wide_part = 0;

INSERT INTO compression_estimate_example
SELECT number FROM system.numbers LIMIT 100_000;

SELECT estimateCompressionRatio(number) AS estimate FROM compression_estimate_example
```

```response title=Response theme={null}
┌───────────estimate─┐
│ 1.9988506608699999 │
└────────────────────┘
```

**Использование конкретного кодека**

```sql title=Query theme={null}
SELECT estimateCompressionRatio('T64')(number) AS estimate FROM compression_estimate_example
```

```response title=Response theme={null}
┌──────────estimate─┐
│ 3.762758101688538 │
└───────────────────┘
```

**Использование нескольких кодеков**

```sql title=Query theme={null}
SELECT estimateCompressionRatio('T64, ZSTD')(number) AS estimate FROM compression_estimate_example
```

```response title=Response theme={null}
┌───────────estimate─┐
│ 143.60078980434392 │
└────────────────────┘
```
