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

supabase / supavisor / 27245246003
77%

Build:
DEFAULT BRANCH: main
Ran 10 Jun 2026 12:48AM UTC
Jobs 2
Files 129
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

10 Jun 2026 12:40AM UTC coverage: 76.525% (+0.3%) from 76.23%
27245246003

push

github

web-flow
perf(db_handler): use LRU eviction for backend prepared statements (#980)

## What kind of change does this PR introduce?

Performance improvement.

## What is the current behavior?

When the per-backend prepared statement set hits the 200-statement
limit, eviction picks 40 entries at random (`Enum.take_random`) and
sends `Close` for them. Hot statements get evicted with the same
probability as cold ones,
so under churn we can drop a frequently used statement and pay for a
fresh `Parse` round-trip on the next `Bind`. Relates to #69 / #239.

## What is the new behavior?
   
Replaces the `MapSet`-backed set with a small LRU storage
(`Supavisor.Protocol.PreparedStatements.BackendStorage`). Recency is
bumped on `Parse` and on `Bind` for statements already known to the
backend. Eviction now drops the least recently used statements first, so
hot ones stay around.

No default behavior change still gated by the
`named_prepared_statements` feature flag. Telemetry
(`prepared_statements_evicted`) is unchanged. Covered by unit tests
(basic API + edge cases) and a `StreamData` property test that checks
the LRU ordering invariant across arbitrary `put`/`touch`/`delete`
sequences.

---------

Co-authored-by: felipe stival <14948182+v0idpwn@users.noreply.github.com>

40 of 40 new or added lines in 4 files covered. (100.0%)

1 existing line in 1 file now uncovered.

2572 of 3361 relevant lines covered (76.52%)

54859.98 hits per line

Coverage Regressions

Lines Coverage ∆ File
1
74.24
-0.76% lib/supavisor.ex
Jobs
ID Job ID Ran Files Coverage
1 run-integration - 27245246003.1 10 Jun 2026 12:48AM UTC 129
41.48
GitHub Action Run
2 run-tests - 27245246003.2 10 Jun 2026 12:52AM UTC 129
75.1
GitHub Action Run
Source Files on build 27245246003
  • Tree
  • List 129
  • Changed 6
  • Source Changed 1
  • Coverage Changed 6
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #27245246003
  • 469aa09e on github
  • Prev Build on main (#27233296123)
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