Remove useless fields from various complex SQL queries
Requires !1406 (merged)
While spending a lot of time updating all the SQL assertions, I noticed many queries were now asking for an image ID and a polygon for no reason. This can cause the queries to be unnecessarily slowed down as deserializing polygons is slow due to the Django PostGIS bindings being slow. This was not really an issue before since we only fetched a zone ID, but now that we are fetching polygons more often, this could become more noticeable.
This applies .only()
wherever possible, only in endpoints that were covered by assertExactQueries
. Using #708 (closed), along with a default .defer('polygon')
could enable us to detect some useless SQL queries being made in other endpoints.
Merge request reports
Activity
requested review from @babadie
added 3 commits
-
49f54553...91d34dc5 - 2 commits from branch
master
- b8cd4370 - Remove useless fields from various complex SQL queries
-
49f54553...91d34dc5 - 2 commits from branch
mentioned in commit 8f2650f2