Hi everyone,

Following up on the 11/23 index community sync, I wanted to raise a
maintenance concern I didn’t get time to discuss. I joined this discussion
relatively late and may have missed earlier relevant discussions, so I’m
not raising this as a blocker, but would appreciate insights regarding how
the community thinks about this problem.

The current index spec requires non-overlapping ordering-key ranges across
region files. This provides a clear read benefit, but I’m a bit concerned
about the maintenance cost for continuously written tables. I see two cases:

   - Hot ordering keys. Maintenance can repeatedly rewrite a growing region
   file. Mitigations such as adding _row_id to the ordering key allow
   splitting, but depend on choosing an appropriate index key upfront.
   - Writes spread across existing key ranges. Even entirely unique keys
   can create substantial write amplification. For example, suppose three
   region files cover [1, 10], [11, 20], and [21, 30]. Inserting previously
   absent keys 3, 15, and 25 would require replacing all three files. A
   batch spread across the whole key space could therefore approach a full
   index rewrite.


My concern is whether this places too much pressure on users choosing
suitable ordering keys upfront, and on index maintainers sustaining the
required rewrite throughput. When maintenance cannot keep pace, index will
become stale and not usable quickly.

One possible compromise would be to allow a bounded (and configurable)
number of "unconsolidated region files" , that themselves must also be
sorted. The example above could initially add one sorted file covering [3,
25], that can later be consolidated. I understand this adds complexity to
the design, but it can continue to offer a reasonable read performance.

If useful, I can look into a prototype to benchmark and identify when the
case I raised becomes a practical limitation, though collecting useful
measurements would take some time and I indeed don't plan to make this a
blocker if this was extensively discussed in the past.

Thanks,
Yan

Reply via email to