RQG Extensions for MariaDB Features

You are viewing an old version of this article. View the current version here.

LimitRowsExamined Transformer

The transformer was developed for testing the functionality added in scope of the task MDEV-28: LIMIT ROWS EXAMINED clause to limit the number of rows examined during SELECT processing. It can be used in the usual way, by providing its name in the --transformers list.

The transformer checks whether the original query already contains a ROWS EXAMINED clause. If it does not, it adds the clause either after the LIMIT clause, or at the end of the query. In any case (even if ROWS EXAMINED was already there), the transformer returns the following sequence of statements:

  • FLUSH STATUS
  • <the query with ROWS EXAMINED>
  • <a query which sums up status variables related to examined rows>

The result of the main query is checked to be a subset of the original query's result set. The sum of status variables is checked to be not greater than the limit provided in the ROWS EXAMINED clause, plus a margin. The margin is configured in the transformer.

If the result of the transformed query appears not to be a subset of the original result set, STATUS_LENGTH_MISMATCH is returned.

If the sum of status variables is greater than the maximum allowed value, STATUS_REQUIREMENT_UNMET is returned.

Note: Status values STATUS_REQUIREMENT_UNMET and STATUS_REQUIREMENT_UNMET_SELECT were added to Constants.pm.

The code can be found in our work tree of the randgen project on Launchpad.

Comments

Comments loading...
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.