we get dynamic position of the data for billions of rows of data now

This commit is contained in:
Filipriec
2026-08-27 22:44:44 +02:00
parent 698e01c7f0
commit 070defe72b
7 changed files with 109 additions and 7 deletions

View File

@@ -418,6 +418,10 @@ message GetTableDataResponse {
// Active journal containing this row's automatic accounting line, when the
// table is ACCOUNTING-enabled and the row has been posted.
optional int64 journal_id = 6;
// Present when the row was loaded through a form-navigation RPC. The row and
// its numbering bounds come from the same server operation.
RowNavigation navigation = 7;
}
// Count non-deleted rows.
@@ -433,13 +437,34 @@ message GetTableDataCountRequest {
message GetLastTableDataRequest {
string profile_name = 1;
string table_name = 2;
RowNavigationMode navigation_mode = 3;
}
// Controls how an unfiltered form numbers rows.
enum RowNavigationMode {
// Actual database row id / highest visible row id. Deleted ids leave gaps.
ROW_NAVIGATION_MODE_ID = 0;
// Ordinal position / exact visible-row count. Deleted rows are omitted.
ROW_NAVIGATION_MODE_POSITION = 1;
}
// Complete numbering state returned with a navigated row.
message RowNavigation {
RowNavigationMode mode = 1;
// Actual row id in ID mode; 1-based ordinal in POSITION mode. For an empty
// table this is the first new-row slot (1).
uint64 current = 2;
// Highest visible id in ID mode; exact visible-row count in POSITION mode.
uint64 total = 3;
}
message GetLastTableDataResponse {
// Zero when the table has no visible rows.
// Zero when the table has no visible rows. Retained as row identity; clients
// should use navigation for display bounds.
int64 last_id = 1;
// Absent when last_id is zero.
GetTableDataResponse row = 2;
RowNavigation navigation = 3;
}
enum RowIdDirection {
@@ -452,11 +477,15 @@ message GetAdjacentTableDataRequest {
string table_name = 2;
int64 anchor_id = 3;
RowIdDirection direction = 4;
RowNavigationMode navigation_mode = 5;
// Current ordinal position when navigation_mode is POSITION. Ignored in ID mode.
uint64 anchor_position = 6;
}
message GetAdjacentTableDataResponse {
// Absent when no visible row exists in the requested direction.
GetTableDataResponse row = 1;
RowNavigation navigation = 2;
}
// Fetch by ordinal position among non-deleted rows (1-based).
@@ -467,6 +496,10 @@ message GetTableDataByPositionRequest {
// Required. Table name within the profile.
string table_name = 2;
// Required. 1-based position by id ascending among rows with deleted = FALSE.
// Set this or record_id, never both. This is the 1-based position by id
// ascending among rows with deleted = FALSE.
int32 position = 3;
// Direct row lookup that also returns its ID or ordinal navigation bounds.
int64 record_id = 4;
RowNavigationMode navigation_mode = 5;
}