# perf\(server\): migrate-dev-db legacy guard uses the V2 created-threads index · pingdotgg/t3code

[View on GitCafe](https://git.cafe/pingdotgg/t3code/commit/9bf8c50e9a2976569d06a3cdbb2fedc6919fe1f2)

Repository: [pingdotgg/t3code](https://git.cafe/pingdotgg/t3code)

Visibility: public

Requested revision: 9bf8c50e9a2976569d06a3cdbb2fedc6919fe1f2

Requested commit: 9bf8c50e9a2976569d06a3cdbb2fedc6919fe1f2

Commit: 9bf8c50e9a2976569d06a3cdbb2fedc6919fe1f2

Tree: eadc69f818de6ffa0fb48c5f8ee68ac8497c96c5

Author: Julius Marminge

Committer: Julius Marminge

## Message

```
perf(server): migrate-dev-db legacy guard uses the V2 created-threads index

Without a hint SQLite answers the correlated NOT EXISTS with a per-thread
stream index scan. On 3000 imported threads with 30000 events that took
150-270ms here and 20.7s in review; with the partial index the importer
already names, it takes about 1.5ms. The index ships in the same migration
as the V2 tables the guard checks for.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

```

## Parents

- [4324451c0aa64be89316fa6c48312bf9174bc093](https://git.cafe/pingdotgg/t3code/commit/4324451c0aa64be89316fa6c48312bf9174bc093?format=markdown)

[Source at this commit](https://git.cafe/pingdotgg/t3code/tree/9bf8c50e9a2976569d06a3cdbb2fedc6919fe1f2?format=markdown)
