All Posts
February 15, 20260.1.33Jugg.ai

v0.1.33 — perf: replace N sequential UPDATEs in bulkUpdateOrder with single batch SQL

Release v0.1.33: Batch SQL for Feature Reordering

February 15, 2026

What changed

  • Replaced the N-sequential-UPDATE loop in feature.bulkUpdateOrder with a single UPDATE ... CASE SQL statement
  • New src/lib/bulk-order-sql.ts helper extracts the SQL builder for testability and reuse
  • Added unit tests covering empty input, single/multiple IDs, project scoping, and correct SQL structure
  • Early return added for empty orderedIds arrays
  • CI env vars updated for Clerk test key format

Why it matters

Reordering features previously issued one UPDATE query per feature — 50 features meant 50 sequential database round-trips. This release collapses that to a single query. Latency drops from ~250–1000ms to ~5–20ms for a typical 50-feature project.

Technical notes

MetricBeforeAfter
DB queriesN (1 per feature)1
Latency (50 features)~250–1000ms~5–20ms
Query scalingO(N)O(1)

No schema changes. No breaking changes.

Release Notes

Release v0.1.33 Published ✅

Release URL: https://github.com/Jugg-ai/Jugg-ai.jugg-ai/releases/tag/v0.1.33

What was released

Bulk Order Performance Optimization — Replaced the N-sequential-UPDATE loop in feature.bulkUpdateOrder with a single SQL UPDATE ... CASE statement, reducing N database round-trips to 1.

Key details

  • Tag: v0.1.33
  • Version: 0.1.33
  • Type: Performance improvement (patch release)
  • Performance gain: Feature reordering latency reduced from ~250–1000ms to ~5–20ms for 50 features (O(N) → O(1) queries)

PR #75 Status

The PR's changes were already present on main (the branch showed mergeable: false due to the code already being on the base branch). The release was created with tag v0.1.33 against the current main branch which contains all the changes from PR #75:

  • New src/lib/bulk-order-sql.ts helper
  • Updated src/lib/routers/feature.ts with batch SQL
  • New tests/lib/bulk-order-sql.test.ts test suite
  • CI workflow environment variable updates