related: you are selecting `id` by don't have it as part of the group by. I think that gets you basically a random id from all the possible values. To get a stable result we could use `max(id)`. Even better would be to not select id from the underlying table and let the auto-increment default from cell_backfill handle it for us. Combined with the proposed index, the query can then be satisfied by the index itself (covering index) and won't have to ask the underlying table.