Skip to content
Snippets Groups Projects

Remove useless fields from various complex SQL queries

Merged Erwan Rouchet requested to merge defer-fields into master

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.

Edited by Erwan Rouchet

Merge request reports

Checking pipeline status.

Approval is optional

Merged by Bastien AbadieBastien Abadie 3 years ago (Jul 26, 2021 9:55am UTC)

Merge details

  • Changes merged into master with 8f2650f2 (commits were squashed).
  • Deleted the source branch.
  • Auto-merge enabled

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading