Skip to content

Conversation

Thirunarayanan
Copy link
Member

@Thirunarayanan Thirunarayanan commented Sep 22, 2025

  • The Jira issue number for this PR is: MDEV-31740

Description

This commit introduces a major refactoring of the InnoDB statistics handling code to improve maintainability and consistency. The main changes include:

Introduced InnoDBStatsRunner class to encapsulate
statistics operations

  • Centralizes statistics-related functionality in a single class
  • Provides cleaner API for table and index statistics operations
  • Handles transaction management and error handling consistently

Replaced direct SQL execution with structured method calls

  • Added TableStat and IndexStat structures for type safety
  • Improved error handling and resource cleanup

Performance optimizations

  • Reduced string allocations by avoiding SQL string building
  • Minimized database roundtrips for statistics operations
  • More efficient memory usage with proper cleanup

How can this PR be tested?

Basing the PR against the correct MariaDB version

  • This is a new feature or a refactoring, and the PR is based against the main branch.
  • This is a bug fix, and the PR is based against the earliest maintained branch in which the bug can be reproduced.

PR quality check

  • I checked the CODING_STANDARDS.md file and my PR conforms to this where appropriate.
  • For any trivial modifications to the PR, I am ok with the reviewer making the changes themselves.

…unner class

This commit introduces a major refactoring of the InnoDB statistics
handling code to improve maintainability and consistency.
The main changes include:

Introduced InnoDBStatsRunner class to encapsulate
statistics operations
 - Centralizes statistics-related functionality in a single class
 - Provides cleaner API for table and index statistics operations
 - Handles transaction management and error handling consistently

Replaced direct SQL execution with structured method calls
 - Added TableStat and IndexStat structures for type safety
 - Improved error handling and resource cleanup

Performance optimizations
  - Reduced string allocations by avoiding SQL string building
  - Minimized database roundtrips for statistics operations
  - More efficient memory usage with proper cleanup
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@Thirunarayanan Thirunarayanan changed the title MDEV-31740: Refactor InnoDB statistics handling with new InnoDBStatsR… MDEV-31740: Refactor InnoDB statistics handling with new InnoDBStatsRunner class Sep 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants