From dc3408cf42e9df4ab02ec28aa5de0a3f2ffebe4a Mon Sep 17 00:00:00 2001 From: lsv Date: Wed, 23 Nov 2022 10:45:37 +0500 Subject: [PATCH] show colour rows statistics page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Строки в статистике по таблицам подсвечиваются, если по таблицам нет статистики оптимизатора. Поле о числе строк в таблице перенесоно ближе к началу. --- schema/pgObject.cpp | 4 +++- schema/pgPartition.cpp | 5 ++++- schema/pgTable.cpp | 6 ++++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/schema/pgObject.cpp b/schema/pgObject.cpp index e9acc5f..b3ebb01 100644 --- a/schema/pgObject.cpp +++ b/schema/pgObject.cpp @@ -248,13 +248,13 @@ void pgObject::ShowStatisticsTables(frmMain* form, ctlListView* statistics, pgOb if (hasSize) statistics->AddColumn(_("Size"), wxLIST_AUTOSIZE); if (obj->GetConnection()->GetIsPgProEnt()) statistics->AddColumn(_("CFS %"), wxLIST_AUTOSIZE); + statistics->AddColumn(_("Live tuples")); statistics->AddColumn(_("Tuples inserted")); statistics->AddColumn(_("Tuples updated")); statistics->AddColumn(_("Tuples deleted")); if (obj->GetConnection()->BackendMinimumVersion(8, 3)) { statistics->AddColumn(_("Tuples HOT updated")); - statistics->AddColumn(_("Live tuples")); statistics->AddColumn(_("Dead tuples")); } if (obj->GetConnection()->BackendMinimumVersion(8, 2)) @@ -322,6 +322,8 @@ void pgObject::ShowStatisticsTables(frmMain* form, ctlListView* statistics, pgOb statistics->SetItem(pos, i++, stats->GetVal(wxT("last_autovacuum"))); statistics->SetItem(pos, i++, stats->GetVal(wxT("last_analyze"))); statistics->SetItem(pos, i++, stats->GetVal(wxT("last_autoanalyze"))); + if (stats->GetVal(wxT("last_analyze")).IsEmpty() && stats->GetVal(wxT("last_autoanalyze")).IsEmpty()) + statistics->SetItemBackgroundColour(pos, wxColour(wxT("#EEAAAA"))); } if (obj->GetConnection()->BackendMinimumVersion(9, 1)) { diff --git a/schema/pgPartition.cpp b/schema/pgPartition.cpp index 0b1a058..cdf3ac6 100644 --- a/schema/pgPartition.cpp +++ b/schema/pgPartition.cpp @@ -109,13 +109,13 @@ void pgPartitionCollection::ShowStatistics(frmMain *form, ctlListView *statistic if (hasSize) statistics->AddColumn(_("Size")); if (GetConnection()->GetIsPgProEnt()) statistics->AddColumn(_("CFS %")); + statistics->AddColumn(_("Live tuples")); statistics->AddColumn(_("Tuples inserted")); statistics->AddColumn(_("Tuples updated")); statistics->AddColumn(_("Tuples deleted")); if (GetConnection()->BackendMinimumVersion(8, 3)) { statistics->AddColumn(_("Tuples HOT updated")); - statistics->AddColumn(_("Live tuples")); statistics->AddColumn(_("Dead tuples")); } if (GetConnection()->BackendMinimumVersion(8, 2)) @@ -179,6 +179,9 @@ void pgPartitionCollection::ShowStatistics(frmMain *form, ctlListView *statistic statistics->SetItem(pos, i++, stats->GetVal(wxT("last_autovacuum"))); statistics->SetItem(pos, i++, stats->GetVal(wxT("last_analyze"))); statistics->SetItem(pos, i++, stats->GetVal(wxT("last_autoanalyze"))); + if (stats->GetVal(wxT("last_analyze")).IsEmpty() && stats->GetVal(wxT("last_autoanalyze")).IsEmpty()) + statistics->SetItemBackgroundColour(pos, wxColour(wxT("#FF8028"))); + } if (GetConnection()->BackendMinimumVersion(9, 1)) { diff --git a/schema/pgTable.cpp b/schema/pgTable.cpp index aead2af..ef96584 100644 --- a/schema/pgTable.cpp +++ b/schema/pgTable.cpp @@ -1302,7 +1302,8 @@ void pgTableCollection::ShowStatistics(frmMain *form, ctlListView *statistics) if (hasSize) statistics->AddColumn(_("Size"), 50); if (GetConnection()->GetIsPgProEnt()) statistics->AddColumn(_("CFS %")); - + statistics->AddColumn(_("Live tuples")); + statistics->AddColumn(_("Tuples inserted")); statistics->AddColumn(_("Tuples updated")); @@ -1310,7 +1311,6 @@ void pgTableCollection::ShowStatistics(frmMain *form, ctlListView *statistics) if (GetConnection()->BackendMinimumVersion(8, 3)) { statistics->AddColumn(_("Tuples HOT updated")); - statistics->AddColumn(_("Live tuples")); statistics->AddColumn(_("Dead tuples")); } if (GetConnection()->BackendMinimumVersion(8, 2)) @@ -1374,6 +1374,8 @@ void pgTableCollection::ShowStatistics(frmMain *form, ctlListView *statistics) statistics->SetItem(pos, i++, stats->GetVal(wxT("last_autovacuum"))); statistics->SetItem(pos, i++, stats->GetVal(wxT("last_analyze"))); statistics->SetItem(pos, i++, stats->GetVal(wxT("last_autoanalyze"))); + if (stats->GetVal(wxT("last_analyze")).IsEmpty()&& stats->GetVal(wxT("last_autoanalyze")).IsEmpty()) + statistics->SetItemBackgroundColour(pos, wxColour(wxT("#FF8028"))); } if (GetConnection()->BackendMinimumVersion(9, 1)) {