Skip to content

Improve admin login performance#711

Open
GUI wants to merge 1 commit intomainfrom
admin-login-perf
Open

Improve admin login performance#711
GUI wants to merge 1 commit intomainfrom
admin-login-perf

Conversation

@GUI
Copy link
Copy Markdown
Member

@GUI GUI commented Apr 4, 2026

When logging into the admin, if the api_users table was very large, performance could be poor for the admins on the initial login. It was due to this fetch of an API key based on the e-mail address that wasn't indexed:

local api_user = ApiUser:select("WHERE email = ? ORDER BY created_at LIMIT 1", "web.admin.ajax@internal.apiumbrella")[1]

This adds an index to improve that query performance.

Fixes 18F/api.data.gov#701

When logging into the admin, if the api_users table was very large,
performance could be poor for the admins on the initial login. It was
due to this fetch of an API key based on the e-mail address that wasn't
indexed:
https://github.com/NatLabRockies/api-umbrella/blob/bdda3929441a24e4aaa6fe114d8770985e0e76d5/src/api-umbrella/web-app/actions/admin/sessions.lua#L201

This adds an index to improve that query performance.
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.

Fix slow admin logins

1 participant