I would like to retrieve a full list of `id` from multiple tables and they could be completely overlapped or mutually exclusive. I am wondering which will have better performance and which is the right way for PostgreSQL, and why is that so?

Say I have 4 tables, and tables are optimized with indices:

**[SELECT DISTINCT ... UNION]**

```
SELECT DISTINCT id from table1
UNION
SELECT DISTINCT id from table2
UNION
SELECT DISTINCT id from table3
UNION
SELECT DISTINCT id from table4
;

```

**[SELECT ... FULL JOIN]**

```
SELECT DISTINCT coalesce(a.id, b.id, c.id, d.id) AS id
FROM table1 a
FULL JOIN table2 b on a.id=b.id
FULL JOIN table3 c on b.id=c.id
FULL JOIN table4 d on c.id=d.id
;

```

*Made some adjustments here. Thanks to @Hogan's suggestion in his answer.*

**Notes**

My entire motivation for the `full join` is because `id` field could be completely overlapped among tables. `full join` could alleviate some of the table scans.