The Admin API user listing (FindUsersInAudience in models/user.go) uses Pop's built-in Paginate() which does SELECT COUNT(*) + SELECT ... LIMIT OFFSET. This doesn't scale well for large user tables.
Related concerns:
- The
COUNT(*) query is expensive on large tables
- MySQL may choose suboptimal indexes for different
instance_id values — index hints are not supported through Pop's query builder
- The filter query uses
LIKE with wildcards on a JSON column with COLLATE, which can't use indexes effectively
- Consider cursor-based pagination or removing pagination entirely if clients don't need total counts
Moved from CI 25, 26, 27
The Admin API user listing (
FindUsersInAudienceinmodels/user.go) uses Pop's built-inPaginate()which doesSELECT COUNT(*)+SELECT ... LIMIT OFFSET. This doesn't scale well for large user tables.Related concerns:
COUNT(*)query is expensive on large tablesinstance_idvalues — index hints are not supported through Pop's query builderLIKEwith wildcards on a JSON column withCOLLATE, which can't use indexes effectivelyMoved from CI 25, 26, 27