Skip to content

fix: spurious sqlite_stat1 NULL-idx rows emitted by ANALYZE#6347

Open
techytoes wants to merge 3 commits intotursodatabase:mainfrom
techytoes:fix-6299-analyze-table-index-emit
Open

fix: spurious sqlite_stat1 NULL-idx rows emitted by ANALYZE#6347
techytoes wants to merge 3 commits intotursodatabase:mainfrom
techytoes:fix-6299-analyze-table-index-emit

Conversation

@techytoes
Copy link
Copy Markdown
Contributor

Description

Make ANALYZE stop emitting the table-level sqlite_stat1(tbl, NULL, stat) row for indexed tables. Turso was inserting it unconditionally, unlike SQLite. Added a focused regression test for the reported repro.

Motivation and context

This is a planner-statistics correctness bug. Indexed tables should only get index stat rows here, matching SQLite.

Closes #6299

Copy link
Copy Markdown

@turso-bot turso-bot bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please review @pereman2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ANALYZE creates spurious NULL-idx rows in sqlite_stat1 for tables with indexes

1 participant