This is a multi-part message in MIME format.
--------------030004050403090402020700
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
Magnus Hagander a écrit :
> Guillaume Lelarge wrote:
>> [...]
>> I'm wondering if we could put all pg_stat_all_tables columns here.
>> That's a lot of informations, but at least some informations seem to
>> be worth it : n_live_tup, n_dead_tup, last_vacuum, last_autovacuum,
>> last_analyze, last_autoanalyze. I would also like to add some other
>> stuff like the % of the table in cache (if pg_buffercache is
>> available).
>>
>> Comments, ideas ?
>
> +1 on the stuff from pg_stat (but make sure to check which columns are
> available in which version)
>
The patch attached takes care of this.
> -1 on the pg_buffercache stuff. That one can be populated using a
> special option I think, but since pg_buffercache takes out some fairly
> heavy locking, we shouldn't do that by default.
>
I agree, it would be better to have an option (disabled by default).
--
Guillaume.
http://www.postgresqlfr.org
http://dalibo.com
--------------030004050403090402020700
Content-Type: text/x-patch;
name="tablesliststats.patch"
Content-Transfer-Encoding: 8bit
Content-Disposition: inline;
filename="tablesliststats.patch"
Index: pgadmin/schema/pgTable.cpp
===================================================================
--- pgadmin/schema/pgTable.cpp (révision 7274)
+++ pgadmin/schema/pgTable.cpp (copie de travail)
@[EMAIL PROTECTED]
-768,10 +768,27 @[EMAIL PROTECTED]
statistics->AddColumn(_("Tuples inserted"), 50);
statistics->AddColumn(_("Tuples updated"), 50);
statistics->AddColumn(_("Tuples deleted"), 50);
+ if (GetConnection()->BackendMinimumVersion(8, 3))
+ {
+ statistics->AddColumn(_("Tuples HOT updated"), 50);
+ statistics->AddColumn(_("Live tuples"), 50);
+ statistics->AddColumn(_("Dead tuples"), 50);
+ }
+ if (GetConnection()->BackendMinimumVersion(8, 2))
+ {
+ statistics->AddColumn(_("Last vacuum"), 50);
+ statistics->AddColumn(_("Last autovacuum"), 50);
+ statistics->AddColumn(_("Last analyze"), 50);
+ statistics->AddColumn(_("Last autoanalyze"), 50);
+ }
if (hasSize)
statistics->AddColumn(_("Size"), 60);
wxString sql=wxT("SELECT st.relname, n_tup_ins, n_tup_upd,
n_tup_del");
+ if (GetConnection()->BackendMinimumVersion(8, 3))
+ sql += wxT(", n_tup_hot_upd, n_live_tup, n_dead_tup");
+ if (GetConnection()->BackendMinimumVersion(8, 2))
+ sql += wxT(", last_vacuum, last_autovacuum, last_analyze,
last_autoanalyze");
if (hasSize)
sql += wxT(", pg_size_pretty(pg_relation_size(st.relid)")
wxT(" + CASE WHEN cl.reltoastrelid = 0 THEN 0 ELSE
pg_relation_size(cl.reltoastrelid) + COALESCE((SELECT
SUM(pg_relation_size(indexrelid)) FROM pg_index WHERE
indrelid=cl.reltoastrelid)::int8, 0) END")
@[EMAIL PROTECTED]
-781,20 +798,35 @[EMAIL PROTECTED]
wxT(" JOIN pg_class cl on cl.oid=st.relid\n")
wxT(" WHERE schemaname = ") + qtDbString(GetSchema()->GetName())
+ wxT("\n ORDER BY relname");
-
+
pgSet *stats = GetDatabase()->ExecuteSet(sql);
if (stats)
{
long pos=0;
+ int i;
while (!stats->Eof())
{
+ i = 4;
statistics->InsertItem(pos, stats->GetVal(wxT("relname")),
PGICON_STATISTICS);
statistics->SetItem(pos, 1, stats->GetVal(wxT("n_tup_ins")));
statistics->SetItem(pos, 2, stats->GetVal(wxT("n_tup_upd")));
statistics->SetItem(pos, 3, stats->GetVal(wxT("n_tup_del")));
+ if (GetConnection()->BackendMinimumVersion(8, 3))
+ {
+ statistics->SetItem(pos, i++,
stats->GetVal(wxT("n_tup_hot_upd")));
+ statistics->SetItem(pos, i++,
stats->GetVal(wxT("n_live_tup")));
+ statistics->SetItem(pos, i++,
stats->GetVal(wxT("n_dead_tup")));
+ }
+ if (GetConnection()->BackendMinimumVersion(8, 2))
+ {
+ statistics->SetItem(pos, i++,
stats->GetVal(wxT("last_vacuum")));
+ 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 (hasSize)
- statistics->SetItem(pos, 4, stats->GetVal(wxT("size")));
+ statistics->SetItem(pos, i, stats->GetVal(wxT("size")));
stats->MoveNext();
pos++;
}
--------------030004050403090402020700
Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
--
Sent via pgadmin-hackers mailing list (pgadmin-hackers@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers
--------------030004050403090402020700--


|