db.l3.ai

Play

lessons

what-changed-in-19

editor

engine: not started

results

Run a query to see rows here.

check

Rewrite for plan

NOT IN is not null-safe, so over a column the planner cannot prove NOT NULL it stays a SubPlan that is probed once per row. NOT EXISTS says the same thing and becomes an Anti Join.

task

Customers with no orders, written with NOT IN, plans as a SubPlan. Rewrite it so the plan has an Anti Join (same rows).

hints