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

> Estimates the compression ratio of a given column without compressing it.

# estimateCompressionRatio

<h2 id="estimateCompressionRatio">
  estimateCompressionRatio
</h2>

Introduced in: v25.4.0

Estimates the compression ratio of a given column without compressing it.

<Note>
  For the examples below, the result will differ based on the default compression codec of the server.
  See [Column Compression Codecs](/reference/statements/create/table#column_compression_codec).
</Note>

**Syntax**

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

**Parameters**

* `codec` — String containing a compression codec or multiple comma-separated codecs in a single string. [`String`](/reference/data-types/string)
* `block_size_bytes` — Block size of compressed data. This is similar to setting both [`max_compress_block_size`](/reference/settings/merge-tree-settings#max_compress_block_size) and [`min_compress_block_size`](/reference/settings/merge-tree-settings#min_compress_block_size). The default value is 1 MiB (1048576 bytes). Maximum allowed value is 256 MiB (268435456 bytes). [`UInt64`](/reference/data-types/int-uint)

**Arguments**

* `column` — Column of any type. [`Any`](/reference/data-types/index)

**Returned value**

Returns an estimate compression ratio for the given column. [`Float64`](/reference/data-types/float)

**Examples**

**Basic usage with default codec**

```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 │
└────────────────────┘
```

**Using a specific codec**

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

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

**Using multiple codecs**

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

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