Skip to content

TideSQL 5 MAJOR (5.0.0) - #157

Open
guycipher wants to merge 9 commits into
masterfrom
5.0.0
Open

TideSQL 5 MAJOR (5.0.0)#157
guycipher wants to merge 9 commits into
masterfrom
5.0.0

Conversation

@guycipher

Copy link
Copy Markdown
Member

No description provided.

@guycipher guycipher self-assigned this Sep 2, 2026
@guycipher guycipher changed the title 5 major code merge in TideSQL 5 MAJOR (5.0.0) Sep 2, 2026
…hen an index is unsampled

records_in_range now probes tidesdb_range_stats over [value, successor(value)) for a
point equality on a non-unique index with no cached sample, so a never-analyzed
low-cardinality index estimates correctly from metadata instead of the records/10
fallback that reads one row per value and drives a full scan. unique, primary-key, and
already-sampled indexes keep the cheap cached rec_per_key, so the sampled path is
unchanged and points/ranges do not regress. adds rir_prefix_successor, updates the
optimizer doc and the index_stats test to the improved before-analyze estimate.
a multi-row DELETE that removes every row across a contiguous primary-key span now
writes one range tombstone instead of a per-row tombstone for each key. delete_row buffers
each primary-row data key and holds its tombstone back; end_bulk_delete counts the live
rows thetouched [min, max] span still holds and, when that equals the buffered count so the
statement removed the whole span, issues one tidesdb_txn_delete_range. a survivor from
aresidual filter, an IN-list gap, an ICP rejection, or an ORDER BY LIMIT leaves more
live rows than buffered keys and falls back to per-row tombstones, so the result never
changes.

advertises HA_CAN_FORCE_BULK_DELETE so the server drives start_bulk_delete for a
single-table delete, which also activates the existing compact-after-range-delete
path.
deferral is skipped for a table with a delete trigger and under galera,
rows than buffered keys and falls back to per-row tombstones, so the result never changes.

advertises HA_CAN_FORCE_BULK_DELETE so the server drives start_bulk_delete for a
single-table delete, which also activates the existing compact-after-range-delete path.
deferral is skipped for a table with a delete trigger and under galera, secondary-index
entries are still deleted per row, a delete past a cap flushes to per-row tombstones, and
the range tombstone carries the library's own OCC conflict detection.

on a pk-only table a 200k-row range delete drops from ~0.33s to 0.192s and from 2.6MB of
tombstone writes to essentially none. adds tidesdb_range_delete covering clean ranges,
gaps, residual filters, LIMIT, rollback, secondary indexes, and triggers.
the analyze table diagnostic prints a write-amplification note whose wal byte
count and derived ratio drift run to run from wal framing, so any test that
records analyze output flakes under heavy parallel load.tidesdb_index_stats
and tidesdb_analyze already normalize these figures with replace_regex, but
tidesdb_row_cardinality recorded them verbatim and so failed intermittently on
a wal= mismatch.apply the same mask before each analyze and keep asserting the
real row counts through information_schema.TABLES, which is what the test is
actually about.

tidesdb_tpcc_contention, flagged alongside this, was investigated and left
unchanged.its retry loop, its 1180/1213/1205 conflict handler, and the commit
path are all correct, and no lost or double increment reproduced across roughly
six hundred executions including two hundred under amplified sixteen-way
contention with forced memtable backpressure, so its single earlier failure
reads as an environmental blip rather than a logic defect.
the neword_incr retry loop gave up an increment under disk pressure.a losing
optimistic attempt rolls back without an fsync, so it can spin through the whole
thousand-try bound while the winning connections are still fsyncing their commits
under full sync mode, then exit having never committed.the district counter then
lands one short and the test fails on a 5004 against 5005.

add a short randomized sleep after a conflicting attempt rolls back, the same way
a real tpc-c client backs off, so the contention drains before the next try and
every increment lands.the asserted counts are unchanged.reproduced reliably by
running the storm under background disk io load, where an unfixed sixteen-way
amplifier failed a hundred of a hundred and twenty runs and the backoff took it to
a hundred and twenty of a hundred and twenty.
…fault table creation may fail with warning, this i documented
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant