3 ms·
select region, count(*) from projects, unnest(region_ids) as region GROUP BY 1;
by Inviz 8y ago
select region, count(*) from projects, unnest(region_ids) as region GROUP BY 1;
- blattimwind 8y agoThe issue (iirc) with that sort of query is that it's essentially a join, so you'll get count(projects)*sum(length(regions)) intermediate rows that need to be grouped back together.