Skip to content

Fix n+1 query issue in message deleteion context#1634

Open
ChrisLovering wants to merge 2 commits into
mainfrom
fix-n+1-issue-in-message-deletion-context
Open

Fix n+1 query issue in message deleteion context#1634
ChrisLovering wants to merge 2 commits into
mainfrom
fix-n+1-issue-in-message-deletion-context

Conversation

@ChrisLovering

@ChrisLovering ChrisLovering commented Jul 9, 2026

Copy link
Copy Markdown
Member

Declare id and author as plain integers to drop DRF's per-row UniqueValidator and FK lookup, and validate all authors and IDs with one batched query each. Query count is now constant instead of 2 per message.

@ChrisLovering ChrisLovering requested review from jb3 and jchristgit July 9, 2026 22:26
@netlify

netlify Bot commented Jul 9, 2026

Copy link
Copy Markdown

Deploy Preview for pydis-static ready!

Name Link
🔨 Latest commit 6ef6742
🔍 Latest deploy log https://app.netlify.com/projects/pydis-static/deploys/6a5021b8a5255e000894bd86
😎 Deploy Preview https://deploy-preview-1634--pydis-static.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

Declare `id` and `author` as plain integers to drop DRF's per-row
UniqueValidator and FK lookup, and validate all authors and IDs with one
batched query each. Query count is now constant instead of 2 per message.
@ChrisLovering ChrisLovering force-pushed the fix-n+1-issue-in-message-deletion-context branch from a71eb85 to 6ef6742 Compare July 9, 2026 22:33
@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 100.0%. remained the same — fix-n+1-issue-in-message-deletion-context into main

@jb3

jb3 commented Jul 9, 2026

Copy link
Copy Markdown
Member

deferring to @jchristgit for a review 🧌

@jb3 jb3 removed their request for review July 9, 2026 23:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants