@freemo 1) yes. there's an index. And the explain shows it's used with the index scan.
2) The group by is needed to get the iteration data together from which the array is created.
The long story is given here: https://stackoverflow.com/q/78130781/916546 with examples how the data looks like.