EXPLAIN
SELECT *
FROM	tab1 a
	JOIN
	tab2 b
	ON b.j = ANY (
		SELECT  k
		FROM	tab3
		WHERE k = b.j);

EXPLAIN
SELECT *
FROM	tab1 a
	JOIN
	tab2 b
	-- Available_rels1 contains both 'a' and 'b'.
	-- Both sublink expression and the subselect can refer to either side
	-- of the JOIN.
	ON a.i = ANY (
		SELECT  k
		FROM	tab3
		WHERE k = a.i);

EXPLAIN
SELECT *
FROM	tab1 a
	LEFT JOIN
	tab2 b
	ON b.j = ANY (
		SELECT  k
		FROM	tab3
		WHERE k = b.j);

EXPLAIN
SELECT *
FROM	tab1 a
	LEFT JOIN
	tab2 b
	ON b.j = ANY (
		SELECT  k
		FROM	tab3
		-- Lateral reference to 'a', no sublink pull-up
	 	WHERE k = a.i); 

EXPLAIN
SELECT *
FROM	tab1 a
	LEFT JOIN
	tab2 b
	-- Lateral reference to 'a', no sublink pull-up
	ON a.i = ANY (
		SELECT  k
		FROM	tab3
	 	WHERE k = b.j); 
