Skip to content

Commit 461882c

Browse files
docs(plan): narrow the buffered-append shape - in-memory buffer + open/write/close per flush boundary
A long-lived buffered stream has the same file-sharing problem as the cached handle (readers blocked), so the viable form of the buffered option is the shape the transaction path already uses: bufferedAppends + FlushBufferedAppends, where the handle is live only during the flush. That makes read-your-writes the real open question: ReadBytesFrom does not consult buffered appends, so a row appended in buffered mode is invisible until the flush.
1 parent 8acfbf9 commit 461882c

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎docs/performance/INSERT_UPDATE_PERFORMANCE_PLAN.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -861,6 +861,14 @@ govern the table append, which is the owner's decision.** Both need a crash-reco
861861
be a config flip. The room is large — 512 µs → 4.5 µs per row — but it is bought with durability, and that
862862
is not a trade to make silently on a database.
863863

864+
The file-sharing constraint narrows the shape of (a): a *long-lived buffered stream* has the same problem
865+
as the cached handle, so the viable form is **buffer the records in memory and flush with a single
866+
open/write/close at the boundary** — exactly the shape the transaction path already uses
867+
(`bufferedAppends` + `FlushBufferedAppends`), where the handle is only live during the flush and readers
868+
are unaffected. The real work in (a) is therefore not the buffering, which exists, but read-your-writes:
869+
`ReadBytesFrom` does not consult buffered appends, so a row appended in buffered mode is invisible until
870+
the flush. That is the piece to design (and to decide on) before this item can move.
871+
864872
INSERT is otherwise already 73.5–84.3K (SQL) / 108.5–132.1K (Direct) / 125.8–138.4K (StructRow) against
865873
SQLite's 133.7–145.1K, and WP14's batch fast path already bought +80%. The remaining, ranked items:
866874

0 commit comments

Comments
 (0)