Below is a map showing all types of subqueries allowed in the SQL language, and the optimizer strategies available to handle them.
x IN (SELECT ...)
FROM
clause x IN (SELECT ...)
queries are the most important, and EXISTS (SELECT ...)
are relatively unimportant. Some things are not on the map:
© 2019 MariaDB
Licensed under the Creative Commons Attribution 3.0 Unported License and the GNU Free Documentation License.
https://mariadb.com/kb/en/subquery-optimizations-map/