When selecting a number of records from a Postgres table based on a list of ids passed as a parameter, what are the benefits and drawbacks of
SELECT id, <more...>
FROM tbl
INNER JOIN UNNEST($1) AS id USING (id)
versus
SELECT id, <more...>
FROM tbl
WHERE id = ANY($1)
and in which cases one should be preferred to the other?
DB: Postgres 14 and above.
Note: This is not a duplicate of Getting by list of ids: `unnest() JOIN` vs `= ANY()` since the list is not constant.