NOT EXISTS or LEFT JOIN which one is better? - Mailing list pgsql-performance

From AI Rumman
Subject NOT EXISTS or LEFT JOIN which one is better?
Date
Msg-id CAGoODpeU62n-gnE2NDMYwPGnszRv6=vmeJac8J=fuBMCNEZHBQ@mail.gmail.com
Whole thread Raw
Responses Re: NOT EXISTS or LEFT JOIN which one is better?
List pgsql-performance
I can write a query to solve my requirement in any of the followings :-

1.
select *
from a
where NOT EXISTS
(
select 1
from b
where a.id = b.id)
union all
select *
from b


2.
select 
(
case when b.id is not null then
   b.id
   else
   a.id
) as id
from a
left join b
  on a.id = b.id

Any one please tell me which one is better?

pgsql-performance by date:

Previous
From: Tom Lane
Date:
Subject: Re: Weird plan variation with recursive CTEs
Next
From: Rich
Date:
Subject: Re: NOT EXISTS or LEFT JOIN which one is better?