Skip to content

Commit

Permalink
Document prepared statement compression properties.
Browse files Browse the repository at this point in the history
  • Loading branch information
mosabua authored and findepi committed Feb 25, 2022
1 parent 3345adb commit 0e340de
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public int getPreparedStatementCompressionThreshold()
}

@Config("protocol.v1.prepared-statement-compression.length-threshold")
@ConfigDescription("Prepared statements longer than the configured value will be compressed")
@ConfigDescription("Compression is applied to prepared statements longer than the configured value")
public ProtocolConfig setPreparedStatementCompressionThreshold(int preparedStatementCompressionThreshold)
{
this.preparedStatementCompressionThreshold = preparedStatementCompressionThreshold;
Expand All @@ -63,7 +63,7 @@ public int getPreparedStatementCompressionMinimalGain()
}

@Config("protocol.v1.prepared-statement-compression.min-gain")
@ConfigDescription("Prepared statement compression will not be applied if size gain is less than the configured value")
@ConfigDescription("Prepared statement compression is not applied if the size gain is less than the configured value")
public ProtocolConfig setPreparedStatementCompressionMinimalGain(int preparedStatementCompressionMinimalGain)
{
this.preparedStatementCompressionMinimalGain = preparedStatementCompressionMinimalGain;
Expand Down
22 changes: 21 additions & 1 deletion docs/src/main/sphinx/admin/properties-general.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ on a per-query basis using the ``redistribute_writes`` session property.
**Type:** ``string``

The 351 release of Trino changes the HTTP client protocol headers to start with
``X-Trino-``. Clients for versions 350 and lower expect the HTTP headers to
``X-Trino-``. Clients for versions 350 and lower expect the HTTP headers to
start with ``X-Presto-``, while newer clients expect ``X-Trino-``. You can support these
older clients by setting this property to ``Presto``.

Expand All @@ -54,3 +54,23 @@ remove usage of this property.
Ensure to use this only as a temporary measure to assist in your migration
efforts.

``protocol.v1.prepared-statement-compression.length-threshold``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

* **Type:** :ref:`prop-type-integer`
* **Default value:** ``2048``

Prepared statements that are submitted to Trino for processing, and are longer
than the value of this property, are compressed for transport via the HTTP
header to improve handling, and to avoid failures due to hitting HTTP header
size limits.

``protocol.v1.prepared-statement-compression.min-gain``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

* **Type:** :ref:`prop-type-integer`
* **Default value:** ``512``

Prepared statement compression is not applied if the size gain is less than the
configured value. Smaller statements do not benefit from compression, and are
left uncompressed.

0 comments on commit 0e340de

Please sign in to comment.