[PR #21010] [MERGED] perf: replace double lookup with single JOIN in authenticate_user_by_email #96922

Closed
opened 2026-05-15 23:18:08 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/21010
Author: @Classic298
Created: 1/28/2026
Status: Merged
Merged: 1/30/2026
Merged by: @tjbck

Base: devHead: user-join


📝 Commits (2)

  • e90752b perf: replace double lookup with single JOIN in authenticate_user_by_email
  • 81d309b Update auths.py

📊 Changes

1 file changed (+12 additions, -5 deletions)

View changed files

📝 backend/open_webui/models/auths.py (+12 -5)

📄 Description

Summary

Eliminates double database lookup in authenticate_user_by_email. Previously, the function queried the Auth table first, then fetched the User separately.

Changes

models/auths.py authenticate_user_by_email:

  • Import User model
  • Replace two separate queries with single JOIN query
  • Auth and User tables joined on id, filtered by email and active status

Performance Impact

Before: 2 queries (Auth lookup + User lookup)
After: 1 query using SQL JOIN

Contributor License Agreement

By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.

Note

Deleting the CLA section will lead to immediate closure of your PR and it will not be merged in.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/open-webui/pull/21010 **Author:** [@Classic298](https://github.com/Classic298) **Created:** 1/28/2026 **Status:** ✅ Merged **Merged:** 1/30/2026 **Merged by:** [@tjbck](https://github.com/tjbck) **Base:** `dev` ← **Head:** `user-join` --- ### 📝 Commits (2) - [`e90752b`](https://github.com/open-webui/open-webui/commit/e90752bc774786318b23b99a63a1c82769a2c4eb) perf: replace double lookup with single JOIN in authenticate_user_by_email - [`81d309b`](https://github.com/open-webui/open-webui/commit/81d309bf77e2a195df0dd2111be7b45aa89b2535) Update auths.py ### 📊 Changes **1 file changed** (+12 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `backend/open_webui/models/auths.py` (+12 -5) </details> ### 📄 Description ## Summary Eliminates double database lookup in authenticate_user_by_email. Previously, the function queried the Auth table first, then fetched the User separately. ## Changes models/auths.py authenticate_user_by_email: - Import User model - Replace two separate queries with single JOIN query - Auth and User tables joined on id, filtered by email and active status ## Performance Impact Before: 2 queries (Auth lookup + User lookup) After: 1 query using SQL JOIN ### Contributor License Agreement By submitting this pull request, I confirm that I have read and fully agree to the [Contributor License Agreement (CLA)](https://github.com/open-webui/open-webui/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT), and I am providing my contributions under its terms. > [!NOTE] > Deleting the CLA section will lead to immediate closure of your PR and it will not be merged in. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-05-15 23:18:08 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#96922