@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.
GNU social JP is a social network, courtesy of GNU social JP管理人. It runs on GNU social, version 2.0.2-dev, available under the GNU Affero General Public License.
All GNU social JP content and data are available under the Creative Commons Attribution 3.0 license.