Skip to content

Conversation

@michae2
Copy link
Collaborator

@michae2 michae2 commented Dec 5, 2025

When loading statistics from a statement bundle directory, the code would previously attempt to process any file starting with "stats-" regardless of its extension. This caused issues when backup files (e.g., files ending with .sql~) were present in the bundle directory, as these would be processed as valid statistics files.

This change adds a check to ensure only files with a .sql extension are processed when loading statement bundle statistics. This allows users to keep backup copies of statistics files (e.g., when manually editing stats for testing different scenarios) without breaking the bundle recreation process.

A new interactive test test_sb_recreate_edited_stats.tcl is added to verify that manually edited statistics are properly loaded during statement bundle recreation. The test creates a bundle, backs up the original stats file, edits the histogram values, and verifies that the edited statistics are used correctly.

🤖 Generated with Claude Code

Epic: None

Release note: none

@cockroach-teamcity
Copy link
Member

This change is Reviewable

When loading statistics from a statement bundle directory, the code
would previously attempt to process any file starting with "stats-"
regardless of its extension. This caused issues when backup files
(e.g., files ending with .sql~) were present in the bundle directory,
as these would be processed as valid statistics files.

This change adds a check to ensure only files with a .sql extension
are processed when loading statement bundle statistics. This allows
users to keep backup copies of statistics files (e.g., when manually
editing stats for testing different scenarios) without breaking the
bundle recreation process.

A new interactive test test_sb_recreate_edited_stats.tcl is added to
verify that manually edited statistics are properly loaded during
statement bundle recreation. The test creates a bundle, backs up the
original stats file, edits the histogram values, and verifies that
the edited statistics are used correctly.

Epic: None

Release note: none

Co-Authored-By: Claude <noreply@anthropic.com>
@michae2 michae2 force-pushed the recreate-stats-suffix branch from 4a5cfad to 9ee3a6e Compare December 6, 2025 00:23
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.

2 participants