Skip to content

Use select_related to avoid an extra query when creating an element

Erwan Rouchet requested to merge select-related-server into master

Select the related ImageServer instead of prefetching it, as prefetching requires Django to retrieve the object then build and run another SQL query to get the server. Using an INNER JOIN is slightly faster:

Endpoint master This branch
CreateElement 98ms 95ms
CreateElement slim_output 58ms 54ms
Edited by Erwan Rouchet

Merge request reports

Loading