Sentry Issue: [POSTHOG-821](https://sentry.io/organizations/posthog/issues/3707400683/?referrer=github_integration)

Sentry is reporting that when listing session recordings loading persons is n+1

Looking at how the query works 

we 
* load person distinct ids for recordings in the list
* load the persons that have those distinct ids
* create a fict of distinct id to person
* for each of the recordings
    * look up the  person in the dict and pass them to a `PersonSerializer`
    * that looks up the person's distinct ids while choosing Person's `name`
    * (maybe only when there's no email) in order to determine the first distinct id for the person
    
 That final lookup of distinct ids is (**I think**) where the n plus 1 problem is. 
 
 For each person one at a time we go to the DB and get their distinct ids
 
 There's no foreign key from `Person` to `PersonDistinctId` so we can't utilise `select_related` here. 
 
 _maybe_ we can if we use a list serializer for Persons and then combine the two lists
 
 Some of the reports suggest 50% of the time generating the list is spent loading persons
posthog/api/session_recording.py
def list_recordings(filter: SessionRecordingsFilter, request: request.Request, team: Team) -> dict:
    (session_recordings, more_recordings_available) = SessionRecordingList(filter=filter, team=team).run()
    if not request.user.is_authenticated:  
        raise exceptions.NotAuthenticated()
    viewed_session_recordings = set(
        SessionRecordingViewed.objects.filter(team=team, user=request.user).values_list("session_id", flat=True)
    )
    distinct_ids = map(lambda x: x["distinct_id"], session_recordings)
    person_distinct_ids = PersonDistinctId.objects.filter(distinct_id__in=distinct_ids, team=team).select_related(
        "person"
    )
    distinct_id_to_person = {}
    for person_distinct_id in person_distinct_ids:
        distinct_id_to_person[person_distinct_id.distinct_id] = person_distinct_id.person
    session_recordings = list(
        map(lambda x: {**x, "viewed": x["session_id"] in viewed_session_recordings}, session_recordings)
    )
    session_recording_serializer = SessionRecordingSerializer(data=session_recordings, many=True)
    session_recording_serializer.is_valid(raise_exception=True)
    results = list(
        map(
            lambda session_recording: {
                **session_recording,
                "person": PersonSerializer(instance=distinct_id_to_person.get(session_recording["distinct_id"])).data,
            },
            session_recording_serializer.data,
        )
    )
    return {"results": results, "has_next": more_recordings_available}