Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8fbf9ba

Browse files
committed
reports(H004): include index_definition like H002
1 parent4393d8a commit8fbf9ba

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

‎reporter/postgres_reports.py‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,8 @@ def generate_h004_redundant_indexes_report(self, cluster: str = "local", node_na
511511

512512
redundant_indexes_by_db= {}
513513
fordb_nameindatabases:
514+
# Fetch index definitions from the sink for this database (used to aid remediation)
515+
index_definitions=self.get_index_definitions_from_sink(db_name)
514516
# Query redundant indexes for each database using last_over_time to get most recent value
515517
redundant_indexes_query=f'last_over_time(pgwatch_redundant_indexes_index_size_bytes{{cluster="{cluster}", node_name="{node_name}", dbname="{db_name}"}}[10h])'
516518
result=self.query_instant(redundant_indexes_query)
@@ -560,6 +562,7 @@ def generate_h004_redundant_indexes_report(self, cluster: str = "local", node_na
560562
"table_size_bytes":table_size_bytes,
561563
"index_usage":index_usage,
562564
"supports_fk":supports_fk,
565+
"index_definition":index_definitions.get(index_name,'Definition not available'),
563566
"index_size_pretty":self.format_bytes(index_size_bytes),
564567
"table_size_pretty":self.format_bytes(table_size_bytes)
565568
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp