Group by unique items in an array column and count records that contain each item
You just need to unnest the arrays into a long form (which I do by joining against the "unnest" function call), and then re-aggregate them.

select item, count(distinct id) from items, unnest(items.items) as item group by item;


If you have to do this on a regular basis, you might want to rethink how you store the data in the first place.