Repository navigation
Commit 396202b
committed
fix(file-search): assert the backfill walk still plans as an index seek
Addresses both cubic findings.
Mark the index `.concurrently()` so a schema reconciliation outside the
hand-written migration also builds it without blocking writes, matching how
workflow_execution_logs_workspace_activity_idx is declared. Drizzle now emits
CREATE INDEX CONCURRENTLY itself; the migration keeps its hand-written wrapper
for lock_timeout and replay recovery.
The walk test only proved logical pagination, which the OR spelling also
satisfies. Record the statements the dispatcher issues and EXPLAIN the exact
backfill SELECT, requiring the cursor to appear as a row-wise index condition.
Reverting to the OR spelling now fails on the plan itself, not just on the SQL
text.
That assertion also exposed a third divergence in the fixture: workspace_id was
declared NOT NULL where production has it nullable, which let PostgreSQL drop
the walk's IS NOT NULL clause and then refuse to match the partial index at all.1 parent 1a3c140 commit 396202b
4 files changed
Lines changed: 50 additions & 4 deletions
File tree
- apps/sim/lib/workspace-files/search
- packages/db
- migrations/meta
Lines changed: 46 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
| 47 | + | |
46 | 48 | | |
47 | 49 | | |
48 | 50 | | |
| |||
51 | 53 | | |
52 | 54 | | |
53 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
54 | 59 | | |
55 | 60 | | |
56 | 61 | | |
| |||
60 | 65 | | |
61 | 66 | | |
62 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
63 | 74 | | |
64 | | - | |
| 75 | + | |
65 | 76 | | |
66 | 77 | | |
67 | 78 | | |
| |||
218 | 229 | | |
219 | 230 | | |
220 | 231 | | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
221 | 266 | | |
222 | 267 | | |
223 | 268 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
26436 | 26436 | | |
26437 | 26437 | | |
26438 | 26438 | | |
26439 | | - | |
| 26439 | + | |
26440 | 26440 | | |
26441 | 26441 | | |
26442 | 26442 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2525 | 2525 | | |
2526 | 2526 | | |
2527 | 2527 | | |
2528 | | - | |
| 2528 | + | |
2529 | 2529 | | |
2530 | 2530 | | |
2531 | 2531 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2308 | 2308 | | |
2309 | 2309 | | |
2310 | 2310 | | |
| 2311 | + | |
2311 | 2312 | | |
2312 | 2313 | | |
2313 | 2314 | | |
| |||
0 commit comments