This filter was introduced in MariaDB MaxScale 2.1.
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.
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
The maxrows filter has no mandatory parameters. Optional parameters are:
Specifies the maximum number of rows a resultset can have in order to be returned to the user.
If a resultset is larger than this an empty result will be sent instead.
Zero or a negative value is interpreted as no limitation.
The default value is
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.
The default value is 64.
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.
0b00000) No logging is made.
0b00001) A decision to handle data form server is logged.
0b00010) Reached max_resultset_rows or max_resultset_size is logged.
0. To log everything, give
debug a value of
Here is an example of filter configuration where the max number of returned rows is 10000 and max allowed resultset size is 256KB
[MaxRows] type=filter module=maxrows max_resultset_rows=10000 max_resultset_size=256000