Commit f751cb4
authored
Incremental topK with fractional index (electric-sql#72)
* WIP incremental topKWithFractionalIndex
* Incremental topKWithFractionalIndex
* Fix tests to not assume particular fractional indices as those are implementation details.
* Introduce a TopK data structure
* B+ tree variant of topKWithFractionalIndex
* Extend unit tests to test all insertion and deletion cases
* Formatting
* Unit test for duplicate values
* Expose useTree option also on sortBy operator
* Split array and B+ tree variants in separate operators
* Add missing imports
* Add a orderBy operator that uses topK with B+ tree variant
* Formatting
* Trigger CI
* Remove useTree option
* Changeset
* Dynamically import B+ tree library
* Also run orderByWithFractionalIndex tests for both the array and B+ tree variant
* Split tree version of orderBy into its own file to enable tree shaking the sorted-btree dependency.
* Improved changeset1 parent 939f2ea commit f751cb4
File tree
11 files changed
+1061
-355
lines changed- .changeset
- packages/d2mini
- src
- operators
- tests/operators
11 files changed
+1061
-355
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
| 53 | + | |
| 54 | + | |
54 | 55 | | |
55 | 56 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
38 | 45 | | |
39 | 46 | | |
40 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
| 131 | + | |
141 | 132 | | |
142 | 133 | | |
143 | 134 | | |
| 135 | + | |
144 | 136 | | |
145 | 137 | | |
146 | 138 | | |
| |||
181 | 173 | | |
182 | 174 | | |
183 | 175 | | |
184 | | - | |
| 176 | + | |
185 | 177 | | |
186 | 178 | | |
187 | 179 | | |
| |||
194 | 186 | | |
195 | 187 | | |
196 | 188 | | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 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 | + | |
0 commit comments