be careful, they might take a while. on my not that big instance they took combined 24s.
select id from (select id from note union all select id from "user" union all select id from "messaging_message") x group by id having count(1) > 1;
select uri from (select uri from note union all select uri from "user" union all select uri from "messaging_message") x where uri is not null group by uri having count(1) > 1;

