limbo/core/mvcc
Jussi Saurio 83de40cea3
Merge 'core/mvcc/cursor: implement count' from Pere Diaz Bou
Sadly, due to how we use dual cursors, we cannot use optimization under
btree cursor to count rows without first checking if the row in btree is
valid. So this is a slow count implementation.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Adds a state-driven `count()` implementation that iterates via dual
cursors, validating B-Tree keys and tallying visible rows.
>
> - **Core (MVCC Cursor)**:
>   - **Counting**:
>     - Implement `count()` using a small state machine (`CountState`)
to iterate (`rewind` → `next`) and tally rows, ensuring B-Tree keys are
validated via existing dual-cursor logic.
>   - **State Management**:
>     - Add `CountState` enum and `count_state` field to
`MvccLazyCursor` to keep count logic isolated from other cursor states.
>     - Initialize `count_state` in `new()`.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
356ea0869d. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com>

Closes #4160
2025-12-10 19:05:01 +02:00
..
database apply claude fix for OpenDup 2025-12-10 13:33:48 -03:00
persistent_storage Merge 'Mvcc bugfixes' from Jussi Saurio 2025-12-03 12:55:58 +02:00
clock.rs core/mvcc: Move source code to module 2025-02-05 13:25:16 +02:00
cursor.rs core/mvcc/cursor: implement count 2025-12-10 16:41:43 +01:00
mod.rs use ArcSwap to store MvStore 2025-12-03 10:09:04 -03:00