Created-order listing reads a whole same-timestamp group per page

Abierto
#16 0 comentarios 0 reacciones 0 asignados Ver en GitHub

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
38/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
javascript

Línea de trabajo

Start by tracing the GET /Memory/ created-order listing and its cursor handling for after=<createdAt>,<id>; the issue does not name the source file or tests. Reproduce the measured case with a large group of identical createdAt values and a page limit of 50, then check row reads across pages. Done means paging through a group no longer reads the entire group on each page while preserving the documented createdAt, then id ordering.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

GET /Memory/?order=created&after=<createdAt>,<id> sorts by createdAt, then id. Harper's index gives the createdAt order, then sorts each group of rows sharing one createdAt by id after reading the whole group. A page that lands inside such a group therefore reads all of it. Walking a group of T rows costs about T²/limit row reads.

Measured on Harper 5.3 (one node, local): a 2,000-row group cost 27 ms on its worst page at limit 50. Import gives one shared now to each batch of up to 100 rows sent without createdAt, so groups larger than that need source data with coarse or repeated timestamps.

Options if it matters: rely on the [value, primaryKey] order of Harper's secondary index and drop the id post-sort when the createdAt index drives the scan, or ask Harper core for a composite continuation (start a range scan at [t, id]).

Found in the pre-push review of the supersession backfill change (branch feat/supersession-backfill).

Review-Deferral: 65e3d9d0468f865d severity=nit category=performance

🤖 Generated by Anthropic Claude (Opus 5.5) via Claude Code; posted via @kriszyp.

Lenguaje dominante
JavaScript
Estrellas
0
Forks
0
Merge medio
20 h 29 min
PR fusionados (30 d)
28

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de HarperFast/agent-memory

Todos los issues de HarperFast/agent-memory

Issues similares

Más issues de JavaScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.