From fbb46f72eb09f2f63baf4814740a214ff58ed847 Mon Sep 17 00:00:00 2001 From: MassimilianoPinto Date: Fri, 11 Nov 2016 11:27:29 +0100 Subject: [PATCH] MXS-930: Maxrows filter documentation MXS-930: Maxrows filter documentation --- Documentation/Filters/Maxrows.md | 66 ++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 Documentation/Filters/Maxrows.md diff --git a/Documentation/Filters/Maxrows.md b/Documentation/Filters/Maxrows.md new file mode 100644 index 000000000..376e9fec9 --- /dev/null +++ b/Documentation/Filters/Maxrows.md @@ -0,0 +1,66 @@ +# Maxrows + +## Overview +The maxrows filter is capable of restricting the amount of rows that a SELECT, a prepared statement or stored procedure +could return to the client application. +If a resultset from a backend server has more rows than the configured limit or the resultset size exceeds the configured size, +an empty result will be sent to the client. + +## Configuration + +The maxrows filter is easy to configure and to add to any existing service. + +``` +[MaxRows] +type=filter +module=maxrows + +[MaxRows Routing Service] +type=service +... +filters=maxrows +``` + +### Filter Parameters + +The maxrows filter has no mandatory parameters. +Optional parameters are: + +#### `max_resultset_rows` + +Specifies the maximum number of rows a resultset can have in order to be +returned to the usere. If a resultset is larger than this an empty result will be sent instead. + +``` +max_resultset_rows=1000 +``` +Zero or a negative value is interpreted as no limitation. + +The default value is `-1`. + +#### `max_resultset_size` + +Specifies the maximum size a resultset can have, measured in kibibytes, +in order to be sent to the client. A resultset larger than this, will +not be sent: an empty resultset will be sent instead. + +``` +max_resultset_size=128 +``` +The default value is 64. + +#### `debug` + +An integer value, using which the level of debug logging made by the maxrows +filter can be controlled. The value is actually a bitfield with different bits +denoting different logging. + + * ` 0` (`0b00000`) No logging is made. + * ` 1` (`0b00001`) A decision to handle data form server is logged. + * ` 2` (`0b00010`) Reached max_resultset_rows or max_resultset_size limit is logged. + +Default is `0`. To log everything, give `debug` a value of `3`. + +``` +debug=2 +```