Skip to content

performance

Performance analysis for database controllers.

Classes:

Classes

PerformanceController

Python
PerformanceController(model: type[ModelT], db: DatabaseService)

Handles query analysis and performance statistics.

Initialize the performance controller.

Parameters:

  • model (type[ModelT]) –

    The SQLModel to analyze performance for.

  • db (DatabaseService) –

    The database service instance.

Methods:

Functions

get_table_statistics async
Python
get_table_statistics() -> dict[str, Any]

Get comprehensive table statistics.

Returns:

  • dict[str, Any]

    Dictionary containing table statistics, column stats, and size info.

explain_query_performance async
Python
explain_query_performance(
    query: Any, analyze: bool = False, buffers: bool = False
) -> dict[str, Any]

Explain query performance with optional analysis.

Returns:

  • dict[str, Any]

    Dictionary containing query execution plan and statistics.