Skip to content

Index extracted rows by container and kind - #261

Merged
abrignoni merged 1 commit into
mainfrom
perf/container-kind-index
Oct 1, 2026
Merged

abrignoni merged 1 commit into
mainfrom
perf/container-kind-index

Conversation

@abrignoni

Copy link
Copy Markdown
Owner

Indexes extracted rows by container and kind, so the sidebar's counts do not read the rows.

  • The index on container_id becomes one on (container_id, kind), made when a case is opened. The older one is dropped.
  • On a fixture with 308,575 extracted rows the count went from 439 ms to 58 ms and the context's container statement from 691 ms to 388 ms.
  • Building it took 250 ms there and 104 ms on a case of 149,824 rows, once per case.
  • Tests check the query plan and a case that still has the older index.

Co-Authored-By: Claude Opus 5.5 [email protected]

The sidebar counts the rows extracted from each container by kind. With
only container_id indexed, that count read every extracted row: on a
fixture with 308,575 of them it took 439 ms of a 691 ms statement.

The index is now on (container_id, kind), made when a case is opened,
and the older index on container_id alone is dropped, since the new one
serves every lookup it did. The count takes 58 ms and the statement 388
ms on that fixture. Building the index took 250 ms there and 104 ms on a
case of 149,824 rows.

Two tests: the plan of the statement the context runs has to find the
rows by container_id from the index alone, and a case that still has the
older index is given the new one.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@abrignoni
abrignoni merged commit 2246de5 into main Oct 1, 2026
8 checks passed
@abrignoni
abrignoni deleted the perf/container-kind-index branch October 1, 2026 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant