Hi Yan,

Thanks for raising this. A very similar question came up in the Sep 28
index sync: whether to allow overlapping region files, possibly with a
limit, to lower maintenance cost on large tables with streaming writes.

We decided to keep region files from overlapping in the first version. That
way, a lookup for a key only ever reads one region file. The cost is that
maintenance has to rewrite more data, and we accepted that for now. If we
allow overlapping files later, it would need a new version of the index
format.

Here is what came up in that sync:

- Uneven key distribution: this came up as data skew rather than hot keys.
The view raised in the sync was that the ordering key must always be
fine-grained enough for maintenance to split a region file, for example
splitting it in two once it doubles in size. So, as you noted, it depends
on choosing the ordering key upfront, and the sync didn't discuss a
fallback when that choice is wrong.
- One extra update file per region was considered earlier: each change
rewrites only that small file, and once it gets large, the whole region is
rewritten. This was put off too, because it wasn't clear the gain was worth
making reads more complex.
- A configurable limit on extra files is a weak guarantee. People can
easily raise it, and then reading the index is just as complex and slow as
having no limit.
- An index that is a few commits behind is still usable. It matches one
table snapshot, and readers check the table changes made after that
snapshot directly. Adding extra files to the index would put another layer
between the two, which can mean more reads, not fewer.
- Whether maintenance can keep up depends on how often the table commits
and how much compute you give it. Flink already keeps a key index in memory
for streaming writes, so it can write deletion vectors instead of equality
deletes, which shows streaming can keep up.

Thanks,
Huaxin

On Mon, Nov 30, 2026 at 4:10 PM Yan Yan <[email protected]> wrote:

> 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