• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

supabase / auth / 21566798362
69%
master: 69%

Build:
Build:
LAST BUILD BRANCH: or/query_reduction
DEFAULT BRANCH: master
Ran 01 Feb 2026 05:09PM UTC
Jobs 1
Files 171
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

01 Feb 2026 05:04PM UTC coverage: 68.91% (+0.06%) from 68.848%
21566798362

Pull #2361

github

olirice
perf(models): optimize user loading from 3 queries to 1 using JSON aggregation

Reduces FindUserWithRefreshToken from 3 separate queries (user + identities + factors)
to a single query using json_agg subqueries. This optimization impacts the
/token endpoint (~45% of total traffic) and /user endpoint by eliminating 2 database
round-trips per call. Since both of those endpoints call FindUserWithRefreshToken twice
it removes 4 database roundtrips per request.

Performance impact:
- Query execution: 399µs → 209µs (47.6% faster)
- Memory allocations: 18.4KB → 7.1KB (61% reduction)
- Allocation count: 299 → 117 allocs (61% reduction)
- /token throughput: +20.3% (55.18 vs 45.87 req/s)
- /token latency: -16.8% (181ms vs 218ms)

In local testing with the database in docker, the optimization allows 20% higher
throughput on the POST /token endpoint.

Replaces Pop ORM .Eager() pattern with explicit SQL column enumeration and
coalesce(json_agg()) for related entities. No changes to User struct or API.
Pull Request #2361: Batch User Model Loading Queries. 32% speedup

55 of 59 new or added lines in 1 file covered. (93.22%)

14948 of 21692 relevant lines covered (68.91%)

81.04 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
4
77.55
1.21% internal/models/user.go
Jobs
ID Job ID Ran Files Coverage
1 21566798362.1 01 Feb 2026 05:09PM UTC 171
68.91
GitHub Action Run
Source Files on build 21566798362
  • Tree
  • List 171
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Pull Request #2361
  • PR Base - master (#21450104510)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc