Repository navigation
Commit 431966e
authored
chore(db): drop unused ANN indexes on embedding (#7955)
* chore(db): drop unused ANN indexes on embedding
Approximate retrieval is served by the compact embedding_search projection.
The only vector ordering left on embedding is an exact rerank wrapped as
(distance) + 0, which the planner cannot match to an index expression, and
the binary_quantize expression indexes were never referenced by any query.
The last app version that ordered by a bare distance has drained, so these
ten indexes were maintained on every chunk write while never being scanned.
* fix(knowledge): let the scale benchmark own its ANN index
The bulk-seed path required embedding_vector_hnsw_idx to exist, dropped it
before seeding and rebuilt it after. With no ANN index left in the schema it
threw before measuring anything. The benchmark seeds embedding directly and
never populates embedding_search, so it now creates its own HNSW index after
the load rather than borrowing a schema one, for both seed paths.1 parent 1db2a00 commit 431966e
6 files changed
Lines changed: 27815 additions & 93 deletions
File tree
- apps/sim/lib/knowledge
- __integration__
- packages/db
- migrations
- meta
Lines changed: 20 additions & 22 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
43 | 52 | | |
44 | 53 | | |
45 | 54 | | |
| |||
386 | 395 | | |
387 | 396 | | |
388 | 397 | | |
389 | | - | |
390 | 398 | | |
391 | 399 | | |
392 | 400 | | |
| |||
397 | 405 | | |
398 | 406 | | |
399 | 407 | | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | | - | |
404 | | - | |
405 | | - | |
406 | | - | |
407 | 408 | | |
408 | 409 | | |
409 | 410 | | |
| |||
420 | 421 | | |
421 | 422 | | |
422 | 423 | | |
423 | | - | |
424 | | - | |
425 | | - | |
426 | | - | |
427 | | - | |
428 | | - | |
429 | | - | |
430 | | - | |
431 | | - | |
432 | | - | |
433 | | - | |
434 | | - | |
435 | | - | |
436 | | - | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
437 | 435 | | |
438 | 436 | | |
439 | 437 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
62 | | - | |
| 61 | + | |
| 62 | + | |
63 | 63 | | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
71 | 72 | | |
72 | 73 | | |
73 | 74 | | |
| |||
Lines changed: 27 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
0 commit comments