Commit de8b694
committed
storage: partition MySQL string PK snapshots by key prefix
Replace the OFFSET-walking boundary discovery with the prefix-based
partitioner in mz-mysql-util, so discovery costs EXPLAIN index dives
instead of an O(rows) index pass.
Only string primary keys are supported. Integer keys, which the OFFSET
walk used to sample, now fall back to a single-worker whole-table read.
Prefixes of a numeric key do not order consistently with its values, so
they would need a separate numeric range splitter.
Boundaries are rendered as SQL literals via the server QUOTE() and
still pass the existing strict-monotonicity verification in each read
transaction.
The new mysql_source_snapshot_partition_min_rows dyncfg (default
50000) stops splitting below a minimum range size. Test configs set it
low so the tiny tables in mysql-cdc testdrive and parallel-workload
still exercise range reads.1 parent ecefb45 commit de8b694
5 files changed
Lines changed: 185 additions & 136 deletions
File tree
- misc/python/materialize
- mzcompose
- parallel_workload
- src
- storage-types/src
- storage/src/source/mysql
- test/mysql-cdc
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
298 | 298 | | |
299 | 299 | | |
300 | 300 | | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
301 | 306 | | |
302 | 307 | | |
303 | 308 | | |
| |||
701 | 706 | | |
702 | 707 | | |
703 | 708 | | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
704 | 712 | | |
705 | 713 | | |
706 | 714 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3046 | 3046 | | |
3047 | 3047 | | |
3048 | 3048 | | |
| 3049 | + | |
| 3050 | + | |
| 3051 | + | |
| 3052 | + | |
| 3053 | + | |
| 3054 | + | |
| 3055 | + | |
| 3056 | + | |
| 3057 | + | |
| 3058 | + | |
| 3059 | + | |
| 3060 | + | |
| 3061 | + | |
| 3062 | + | |
3049 | 3063 | | |
3050 | 3064 | | |
3051 | 3065 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
218 | 238 | | |
219 | 239 | | |
220 | 240 | | |
| |||
438 | 458 | | |
439 | 459 | | |
440 | 460 | | |
| 461 | + | |
| 462 | + | |
441 | 463 | | |
442 | 464 | | |
443 | 465 | | |
| |||
0 commit comments