Closed
Description
Currently the SnapshotUtil
is going over all the history entries of a table (with O(n) complexity).
Long snapshotId = null;
for (HistoryEntry logEntry : table.history()) {
if (logEntry.timestampMillis() <= timestampMillis) {
snapshotId = logEntry.snapshotId();
}
}
In case that the org.apache.iceberg.Table#history
would be guaranteed to be ordered, a binary search algorithm could be used instead (O(log n) complexity).
Metadata
Metadata
Assignees
Labels
No labels