Skip to content

docs(storage): re-measure the single-file SQL matrix against the code (#571) - #581

Merged
MPCoreDeveloper merged 1 commit into
masterfrom
docs/571-measured-single-file-matrix
Dec 6, 2026
Merged

MPCoreDeveloper merged 1 commit into
masterfrom
docs/571-measured-single-file-matrix

Conversation

@MPCoreDeveloper

Copy link
Copy Markdown
Owner

Why

Issue #571 says .scdb single-file mode "does not support JOIN, GROUP BY, subqueries, aggregates, DELETE without WHERE
and other advanced SQL (see docs/storage/SINGLE_FILE_SQL_LIMITATIONS.md)". The user pushed back: we aligned the SQL
syntax a while ago, and the docs drift from the code.

So I stopped reading and executed the whole matrix instead: the same DDL, the same rows and the same statements
against a .scdb file and a directory database, side by side, on 2026-12-06.

Result

JOIN (INNER/LEFT/RIGHT/FULL), GROUP BY, HAVING, subqueries in FROM and WHERE, aggregates, window functions,
UNION, CASE, DISTINCT, LIKE, IN, BETWEEN, IS [NOT] NULL, ORDER BY, LIMIT/OFFSET, every
ALTER TABLE form and DELETE/UPDATE without WHERE return the same rows on both modes. The issue's premise
was stale — there is nothing to lift.

What the measurement did find

Five claims in the old file were wrong, and there are four real defects (filed as #580 with the evidence and
workarounds):

Claim in the old file Measured
INSERT OR IGNORE / INSERT OR REPLACE ✅ Unsupported SQL statement: INSERT OR in both modes
sqlite_master ✅ on single-file 0 rows (directory answers it)
sqlite_schema ✅ on both throws on directory, 0 rows on single-file
BEGIN/COMMIT/ROLLBACK "silently ignored" on single-file rejected with Unsupported SQL statement in both modes
STORAGE = COLUMNAR ❌ on single-file accepted, the hint is ignored, the table is created
EXPLAIN ✅ accepted, returns 0 rows in both modes (no plan contract yet — #569)

The old file also carried a broken duplicate FluentMigrator table (half the rows had no directory column, and two
rows contradicted the table above them). Removed.

Real defects found while measuring: a view is registered but SELECT … FROM <view> answers
Table <view> does not exist in both modes; WHERE predicates that meet a NULL disagree between the modes and both
depart from SQL; SUM/AVG/MIN/MAX over a column containing a NULL throw InvalidCastException;
sqlite_master/sqlite_schema are inconsistent between the modes.

What the file looks like now

Every matrix states the method and the date, the corrected rows carry the observed behaviour, the four defects are a
Verified gaps section with the workaround a consumer should use today (AND col IS NOT NULL,
information_schema), the FluentMigrator table is one clean table, and the footer says how it was produced so the next
reader re-runs it instead of trusting it.

…fixes #571)

The file claimed INSERT OR IGNORE/REPLACE, sqlite_master/sqlite_schema and BEGIN/COMMIT/ROLLBACK work on both modes, that STORAGE=COLUMNAR is unsupported on single-file and that a broken duplicated FluentMigrator table was authoritative. Every row was re-derived by executing it on 2026-12-06 against a .scdb file and a directory database side by side: five claims were wrong, and the measurement found four real defects (views registered but not queryable, WHERE/NULL divergence between the modes, SUM/AVG/MIN/MAX throwing on a NULL, sqlite_master/sqlite_schema inconsistent). Those are documented as Verified gaps with workarounds and tracked in #580; the matrices now state their method and date. JOIN/GROUP BY/subqueries/aggregates/DELETE without WHERE are at parity, so #571 static limitation list was stale.
@sonarqubecloud

sonarqubecloud Bot commented Dec 6, 2026

Copy link
Copy Markdown

@codecov

codecov Bot commented Dec 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@MPCoreDeveloper
MPCoreDeveloper merged commit b6df9e5 into master Dec 6, 2026
14 checks passed
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