The ListTranscriptions recursive parameter can cause an OOM or timeouts
element_id__in=[element.id, *Element.objects.get_descending(element.id).values_list('id', flat=True)]
is used to filter recursively instead of using a normal SQL subquery. The *
causes every single element to be loaded in memory, added to the list, then sent to Django for deserialization; this can be very time- and memory-consuming when using the endpoint for elements with a lot of children.
Edited by Erwan Rouchet