Skip to content

[#83] Call handler finalization so their indexes are created - #156

Merged
SkowronskiAndrew merged 1 commit into
mainfrom
issue83-analyze-indexes
Nov 3, 2026
Merged

SkowronskiAndrew merged 1 commit into
mainfrom
issue83-analyze-indexes

Conversation

@SkowronskiAndrew

Copy link
Copy Markdown
Collaborator

Summary

Fixes #83.

Each ISQLiteHandler had a Finalize(SqliteConnection) method that nothing called, so the indexes
that AssetBundleHandler and ShaderHandler meant to create were missing from every analyze database.
This change wires up the hook rather than deleting the indexes, because all four are on columns that
matter for large builds:

  • shader_subprograms(shader) and shader_subprogram_keywords(subprogram_id): shader_view runs
    correlated subqueries per shader against both tables, so without the indexes each shader scans
    them. With heavy variant counts these tables reach millions of rows.
  • preload_dependencies(object) and preload_dependencies(dependency): the table grows with
    bundles × assets × dependencies. object is the join key of preload_dependencies_view, and
    dependency answers "what preloads this object".

Changes

  • ISQLiteHandler.FinalizeDatabase(SqliteConnection) is now part of the interface, as a default no-op
    method. The nine empty stubs are deleted. It is named after ISQLiteFileParser.FinalizeDatabase
    and avoids the Finalize destructor name.
  • SerializedFileSQLiteWriter.FinalizeDatabase calls it on every handler after all files are
    processed, before the --skip-references early return. It is not in Finalize.sql because the
    handler tables exist only when a SerializedFile was parsed.
  • Schema version 11.

Testing

  • dotnet test: full suite green.
  • New Analyze_HandlerIndexes_AreCreated checks that all four indexes exist, with and without
    --skip-references.

🤖 Generated with Claude Code

@SkowronskiAndrew
SkowronskiAndrew merged commit 4a62d9b into main Nov 3, 2026
6 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.

Handler Finalize() methods are never called, so intended indexes are never created

1 participant