Adding slots runs two queries per slot
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Refactorización
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- sql, typescript
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- TypeScript
- Estrellas
- 19
- Forks
- 4
- Merge medio
- 22 h 46 min
- PR fusionados (30 d)
- 170
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de richshaw/OpenSignup
-
bug pipeline:proposed pipeline:ux
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
richshaw/OpenSignup#711 ·
Los mantenedores suelen responder en 1 día
-
Participant name and notes limits are typed twice, in the schemas and on the participant pagesPosiblemente ocupada @bfs2021 la tomó hace 2 días. Abiertoenhancement good first issue pipeline:ready
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
richshaw/OpenSignup#705 ·
Los mantenedores suelen responder en 1 día
-
enhancement pipeline:proposed pipeline:ux
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
richshaw/OpenSignup#654 ·
Los mantenedores suelen responder en 1 día
-
enhancement pipeline:proposed pipeline:ux
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
richshaw/OpenSignup#652 ·
Los mantenedores suelen responder en 1 día
-
enhancement pipeline:proposed pipeline:ux
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
richshaw/OpenSignup#589 ·
Los mantenedores suelen responder en 1 día
Todos los issues de richshaw/OpenSignup
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
better-auth/better-auth#12132 · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
o8 next debug build aborts on Glass to Dark appearance switch (nil identifier messaged before check)Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
hurttlocker/o8#5112 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
webrecorder/wabac.js#386 ·
-
needs-triage
Dificultad 1/5 1-3 horas Aptitud para principiantes 92/100
agent-of-empires/agent-of-empires#5098 · 1 comentario · 1 reacción ·
Los mantenedores suelen responder en 1 día