--query returns 162 rows
explain analyze
SELECT
	*
FROM
	t1
	INNER JOIN t2 ON (
		EXISTS (
			SELECT
				true
			FROM
				t3
			WHERE
				t3.id1 = t1.id	AND
				t3.id2 = t2.id
		)
	)
WHERE
	t1.name = '5c5fec6a41b8809972870abc154b3ecd'
;

set enable_seqscan=off;

--the same query returns only one row!
explain analyze
SELECT
	*
FROM
	t1
	INNER JOIN t2 ON (
		EXISTS (
			SELECT
				true
			FROM
				t3
			WHERE
				t3.id1 = t1.id	AND
				t3.id2 = t2.id
		)
	)
WHERE
	t1.name = '5c5fec6a41b8809972870abc154b3ecd'
;

explain analyze
SELECT
    t1.*
FROM
	t1, t2, t3
WHERE
	t1.name = '5c5fec6a41b8809972870abc154b3ecd' AND
	t3.id1 = t1.id  AND
	t3.id2 = t2.id;
