---
title: "ZSTD_COMPRESS"
description: "La funzione SQL ZSTD_COMPRESS comprime un BLOB utilizzando l\u0027algoritmo Zstandard."
language: it
source_language: en
translation_state: complete
canonical: https://documentation.invantive.eu/it/docs/invantive-universalsql/grammar/sql-functions/zstd-compress
original: https://documentation.invantive.eu/en/docs/invantive-universalsql/grammar/sql-functions/zstd-compress
updated: 2026-12-04T14:58:57Z
license: https://documentation.invantive.eu/it/
---

## Sintassi
```mermaid
%%{init: {
  'theme': 'base',
  'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
  'themeVariables': {
    'fontSize': '11px',
    'fontFamily': 'Arial'
  }
}}%%
flowchart LR
    Start((START)) --> ZSTD_COMPRESS[ZSTD_COMPRESS]:::quoted
    ZSTD_COMPRESS --> End((END))
```

## Scopo
La funzione SQL `ZSTD_COMPRESS` comprime un'immagine `blob` utilizzando l'algoritmo Zstandard.

Vedi anche [[ZSTD_DECOMPRESS]] e [[ZLIB_COMPRESS]].

Parametri:
- input (`blob`): L'immagine `blob` da comprimere.

Restituisce: una versione dell'input compressa con Zstandard.

## Esempi
L'esempio seguente comprime e decomprime i nove caratteri ASCII `ACME` e recupera il testo originale:
```sql
select blob_to_text(zstd_decompress(zstd_compress(ascii_to_blob('ACME'))))

-------------------
ACME
```
L'esempio seguente comprime un testo e recupera l'immagine compressa `blob`, codificata in base64:
```sql
select base64_encode(zstd_compress('VGhpcyBpcyBhIHZlcnkgbG9uZyB0ZXh0IHRvIHRlc3QgdGhlIFpzdGQgY29tcHJlc3Npb24gbWV0aG9k'))

-------------------
KLUv/SA8vQEAwsMMFLAnHd2OTKNtYpi2ISYmwTDAZCECxao8IzN3TMax4dILZvUeu/Ui7ASy4iTxWPjMZwoIAA==
```

