admin-analytics: optimize user management data layer
There are no commits yet
Push commits to the source branch or add previously merged commits to review them.
Created by: erzhtor
It seems that because user management SQL queries use join
large event_logs and users tables to create a full in-memory table, the GQL API response is slow and even fails with a time-out exception.
This PR:
internal/users/stats.go
fileaggregated_user_statistics
table which is updated/seeded every 12 hoursSiteUser.displayName
GQL fieldsg start
query UsersManagementUsersList {
site {
users(query: null, lastActivePeriod: THIS_MONTH) {
totalCount
nodes(first: 25, orderBy: EVENTS_COUNT, descending: true) {
id
username
email
siteAdmin
eventsCount
createdAt
lastActiveAt
deletedAt
}
}
}
}
Push commits to the source branch or add previously merged commits to review them.