Conversion of big IN predicates into subqueries

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

Starting from MariaDB 10.3, the optimizer will convert big IN predicates into subqueries. That is, an IN predicate in form

column [NOT] IN (const1, const2, .... )

with a sufficiently large number of elements in the list (more than 1000) will be converted into a subquery:

column [NOT] IN (select ... from temporary_table)

Controlling the optimization

  • There is no optimizer_switch flag for this optimization.
  • Debug builds have @@in_predicate_conversion_threshold parameter.

https://jira.mariadb.org/browse/MDEV-12176

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.