UNION versus SUB SELECT - Mailing list pgsql-performance

From Robert DiFalco
Subject UNION versus SUB SELECT
Date
Msg-id CAAXGW-w+pF+8Prk9p9SRYwZ56FboRFj6wkSvCh0xUGpFns6uhA@mail.gmail.com
Whole thread Raw
Responses Re: UNION versus SUB SELECT
List pgsql-performance
I have found this:

SELECT c.* 
FROM contacts c
WHERE c.id IN ( SELECT p.contact_id FROM phone p WHERE p.addr = ? )
OR c.id IN (SELECT e.contact_id FROM email e WHERE e.addr = ? );

To have a worse plan than:

SELECT * FROM contacts where id IN (
( SELECT c.id FROM contacts c 
JOIN phone p ON c.id = p.contact_id AND p.addr = ? 
UNION
SELECT c.id FROM contacts c 
JOIN email e ON c.id = e.contact_id AND e.addr = ? );

Maybe this is no surprise. But after discovering this my question is this, is there another option I dont' know about that is logically the same that can perform even better than the UNION?

pgsql-performance by date:

Previous
From: Rogerio Pereira
Date:
Subject: Error install -pgmemcache
Next
From: desmodemone
Date:
Subject: Re: UNION versus SUB SELECT