diff --git a/docs/en_US/hints/vacuum-full.html b/docs/en_US/hints/vacuum-full.html new file mode 100644 index 0000000..60b35de --- /dev/null +++ b/docs/en_US/hints/vacuum-full.html @@ -0,0 +1,33 @@ + + +
+ + ++VACUUM FULL is not recommended on PostgreSQL versions prior to 9.0, except +in extreme circumstances. +
++VACUUM FULL should only be used if large amounts of data has been updated +or deleted in a table, in order to release space back to the operating system, +and only in cases where this space is not expected to be used by the table +in the future. A regular VACUUM, without FULL, is usually enough in normal +circumstances. +
++VACUUM FULL will take out exclusive locks in the database, preventing +all other activity on the table(s) being VACUUMed, and as such will +have very large impact on other users of the database while it runs. +
++After a table or database has been VACUUM FULL:ed, it is recommended to +always REINDEX all indexes on the table as well. +
+ + diff --git a/pgadmin/frm/frmHint.cpp b/pgadmin/frm/frmHint.cpp index 27ca804..872712b 100644 --- a/pgadmin/frm/frmHint.cpp +++ b/pgadmin/frm/frmHint.cpp @@ -93,6 +93,13 @@ hintArray[] = HINT_CANSUPPRESS | HINT_CANFIX }, { + HINT_VACUUM_FULL, + __("Running VACUUM FULL not recommended"), + __("VACUUM FULL"), + wxT("pg/sql-vacuum"), + HINT_CANSUPPRESS | HINT_CANABORT + }, + { HINT_QUERYRUNTIME, __("Query took a long time to complete"), 0, diff --git a/pgadmin/frm/frmMaintenance.cpp b/pgadmin/frm/frmMaintenance.cpp index 9a6585d..fa65548 100644 --- a/pgadmin/frm/frmMaintenance.cpp +++ b/pgadmin/frm/frmMaintenance.cpp @@ -18,6 +18,7 @@ // App headers #include "pgAdmin3.h" #include "ctl/ctlMenuToolbar.h" +#include "frm/frmHint.h" #include "frm/frmMaintenance.h" #include "frm/frmMain.h" #include "utils/sysLogger.h" @@ -120,6 +121,13 @@ wxString frmMaintenance::GetSql() { case 0: { + /* Warn about VACUUM FULL on < 9.0 */ + if (chkFull->GetValue() && + !conn->BackendMinimumVersion(9, 0)) + { + if (frmHint::ShowHint(this, HINT_VACUUM_FULL) == wxID_CANCEL) + return wxEmptyString; + } sql = wxT("VACUUM "); if (chkFull->GetValue()) diff --git a/pgadmin/include/frm/frmHint.h b/pgadmin/include/frm/frmHint.h index a5edf67..91f0ca6 100644 --- a/pgadmin/include/frm/frmHint.h +++ b/pgadmin/include/frm/frmHint.h @@ -19,6 +19,7 @@ #define HINT_PRIMARYKEY wxT("pk") #define HINT_FKINDEX wxT("fki") #define HINT_VACUUM wxT("vacuum") +#define HINT_VACUUM_FULL wxT("vacuum-full") #define HINT_QUERYRUNTIME wxT("query-runtime") #define HINT_INSTRUMENTATION wxT("instrumentation") #define HINT_ENCODING_ASCII wxT("encoding-ascii")