Adding slots runs two queries per slot
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Refactoring
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- sql, typescript
Direzione di ricerca
Start with the three loops in addSlot, addSlotsBulk and createSignup, plus extractSlotAt and pickAvailableRef, and check how the signup lock is held. The work depends on #372 (withSignupWriteLock), so confirm that lands first. Done means a 500-row bulk add runs a fixed number of statements, pinned by a test, while slots.db.test.ts, signups.db.test.ts and the MCP tools.db.test.ts pass, and docs/telemetry.md reflects the new activity payload.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What happens
addSlot, addSlotsBulk and createSignup each loop over the rows. For each row they:
- run
extractSlotAt - run
pickAvailableRef, which does a SELECT per attempt - do a one-row INSERT
That is about 2N statements for N slots. A 500-row bulk add, or an add_slots call of that size, runs about 1,000, all while holding the signup lock.
createSignup also inserts its fields one at a time. The three loops are nearly the same code.
Fix, in outline
-
One
insertSlots(tx, signup, fields, rows)that:- reads the signup's existing refs once
- picks the new refs in memory
- does one multi-row INSERT
Every caller already holds the signup lock, or owns a signup nobody else can see yet. The
slots_ref_uniqueconstraint stays as the safety net. -
addSlotbecomes a thin call into the bulk path, keeping its capacity default of 1. -
createSignupinserts its fields in one statement. -
Use the ids made in code, not the order RETURNING gives back, for the
beforeSlotIdsplice.
Watch for
- A single add's activity payload becomes the bulk shape,
{ count, bulk: true, slotIds }. Nothing reads it, butdocs/telemetry.mddescribes both shapes (after #356), so update it. - The format of the ref suffix may change. Refs are internal and never shown.
Order
After #372, which adds withSignupWriteLock.
Done when
- A 500-row bulk add runs a fixed number of statements, pinned by a test.
slots.db.test.ts,signups.db.test.tsand the MCPtools.db.test.tspass.pnpm lint && pnpm typecheck && pnpm knip && pnpm test && pnpm test:dbpass.
- Lingua principale
- TypeScript
- Stelle
- 19
- Fork
- 4
- Merge medio
- 22h 10m
- PR unite (30g)
- 168
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di richshaw/OpenSignup
-
Participant name and notes limits are typed twice, in the schemas and on the participant pagesForse già presa @bfs2021 l’ha presa oggi. Apertaenhancement good first issue pipeline:ready
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
richshaw/OpenSignup#705 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement pipeline:proposed pipeline:ux
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
richshaw/OpenSignup#654 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement pipeline:proposed pipeline:ux
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
richshaw/OpenSignup#652 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement pipeline:proposed pipeline:ux
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
richshaw/OpenSignup#589 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement pipeline:proposed pipeline:ux
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
richshaw/OpenSignup#588 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di richshaw/OpenSignup
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
vekexasia/pi-extensible-workflows#374 ·
I maintainer di solito rispondono entro 2 giorni
-
documentation good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
I maintainer di solito rispondono entro 1 giorno
-
help wanted linux
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
GiuseppeBellamacina/downtime#19 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
scaleway/ultraviolet#7089 ·
I maintainer di solito rispondono entro 2 giorni
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
Get-Concord-AI/concord-mcp#296 ·
I maintainer di solito rispondono entro 1 giorno