Commit 48da9fc
committed
improvement(knowledge): index the projection by source; rank a narrow reader's keyword window once
- a partial btree on embedding_search.connector_id lets the planner lead with a few sources where the caller's tokens alone would match most of the index, which is what made a small slice cost a bitmap over all of it
- a narrow reader's keyword page returns several pages' worth of readable rows from one wide ranking, instead of ranking the window again for each page1 parent 9b57644 commit 48da9fc
3 files changed
Lines changed: 29 additions & 10 deletions
File tree
- apps/sim/lib/knowledge/search
- packages/db/script-migrations
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1574 | 1574 | | |
1575 | 1575 | | |
1576 | 1576 | | |
1577 | | - | |
| 1577 | + | |
1578 | 1578 | | |
1579 | 1579 | | |
1580 | 1580 | | |
| 1581 | + | |
1581 | 1582 | | |
1582 | 1583 | | |
1583 | 1584 | | |
| |||
1589 | 1590 | | |
1590 | 1591 | | |
1591 | 1592 | | |
| 1593 | + | |
| 1594 | + | |
1592 | 1595 | | |
1593 | 1596 | | |
1594 | 1597 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
516 | 516 | | |
517 | 517 | | |
518 | 518 | | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
519 | 522 | | |
520 | 523 | | |
521 | 524 | | |
| |||
1837 | 1840 | | |
1838 | 1841 | | |
1839 | 1842 | | |
1840 | | - | |
1841 | | - | |
1842 | | - | |
1843 | | - | |
| 1843 | + | |
| 1844 | + | |
| 1845 | + | |
| 1846 | + | |
| 1847 | + | |
| 1848 | + | |
| 1849 | + | |
| 1850 | + | |
| 1851 | + | |
| 1852 | + | |
| 1853 | + | |
1844 | 1854 | | |
1845 | 1855 | | |
1846 | 1856 | | |
| |||
1868 | 1878 | | |
1869 | 1879 | | |
1870 | 1880 | | |
1871 | | - | |
| 1881 | + | |
1872 | 1882 | | |
1873 | 1883 | | |
1874 | 1884 | | |
| |||
1878 | 1888 | | |
1879 | 1889 | | |
1880 | 1890 | | |
1881 | | - | |
| 1891 | + | |
1882 | 1892 | | |
1883 | 1893 | | |
1884 | 1894 | | |
| |||
Lines changed: 9 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
132 | | - | |
133 | | - | |
134 | | - | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
135 | 137 | | |
136 | 138 | | |
137 | 139 | | |
| |||
143 | 145 | | |
144 | 146 | | |
145 | 147 | | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
146 | 152 | | |
147 | 153 | | |
148 | 154 | | |
| |||
0 commit comments