Skip to content

Optimize or replace Admin API pagination #412

@VaibhavAcharya

Description

@VaibhavAcharya

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions