[MDEV-22386] Transformation of queries with NOT IN predicands into queries with anti-joins Created: 2020-04-28  Updated: 2020-04-28

Status: Open
Project: MariaDB Server
Component/s: Optimizer
Fix Version/s: None

Type: Task Priority: Major
Reporter: Igor Babaev Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None


 Description   

A query of the form
SELECT * FROM t1 WHERE P1(t1) AND t1.a NOT IN (SELECT t2.a FROM t2 WHERE P2(t2,t1)
can be transformed into the equivalent query
SELECT * FROM t1 LEFT JOIN ON t1.a=t2.a AND P2(t2,t1) WHERE P1(t1)
if t1.a is not nullable.

After transformation a hash join algorithm can be employed when there is no indexes matching t2.a


Generated at Thu Feb 08 09:14:21 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.