diff options
author | 2024-04-01 20:08:02 +0200 | |
---|---|---|
committer | 2024-04-01 20:21:49 +0200 | |
commit | 084b52b1c5f7cf9e02c64361972b75b19bc1a8dc (patch) | |
tree | 84fb250db8e44bcb396a2bf0ed033cd5d97fe5ec /pydis_site/apps/api/serializers.py | |
parent | Merge pull request #1286 from python-discord/jb3/filterlist-perf-improvements (diff) |
Upsert tags in two queries
Before, we had an N+1 query, where each tag would be separately fetched
and updated. Instead, first delete any tags we no longer care about,
then perform an upsert of all fields except for `last_commit`, which we
want to keep from the existing tag.
This comes with one caveat: on the first update of the tags, the `tags`
list is no longer modified in-place, because mutation is bad, however,
the database state is updated accordingly.
Diffstat (limited to 'pydis_site/apps/api/serializers.py')
0 files changed, 0 insertions, 0 deletions