Here is a patch that enable "analyze only" support. For the time being
(unless there are objections), this feature is manifested as another
check box on the Vacuum dialog, which says "Analyze only (don't
vacuum). This will perform a "ANALYZE ..." instead of a "VACUUM ANALYZE
...". There is also a small "bug" fix in this patch, in that since
analzye doesn't return any data, there is no thread->DataSet() created,
so a call to thread->DataSet()->NumRows() when thread->DataSet() == NULL
will cause a segfault.
If this patch is acceptable to everyone (read Andreas...:-P), then
please apply.
ahp
diff -ur pgadmin3/src/ui/common/frmVacuum.xrc pgadmin3.new/src/ui/common/frmVacuum.xrc
--- pgadmin3/src/ui/common/frmVacuum.xrc2003-05-02 11:34:37.0 -0400
+++ pgadmin3.new/src/ui/common/frmVacuum.xrc2003-07-02 14:46:02.0 -0400
@@ -2,12 +2,12 @@
VACUUM an object
-300, 190
+300, 210
wxSTAY_ON_TOP|wxCAPTION|wxSYSTEM_MENU
VACUUM options
10,10
- 280,85
+ 280,105
Full
@@ -22,22 +22,26 @@
1
35, 70
+
+Analyze only (don't vacuum)
+75, 90
+
- 100,100
+ 100,110
64,64
&OK
1
- 130, 160
+ 130, 180
80, 25
&Cancel
0
- 215, 160
+ 215, 180
80, 25
-
\ No newline at end of file
+
diff -ur pgadmin3/src/ui/frmVacuum.cpp pgadmin3.new/src/ui/frmVacuum.cpp
--- pgadmin3/src/ui/frmVacuum.cpp 2003-06-17 10:00:20.0 -0400
+++ pgadmin3.new/src/ui/frmVacuum.cpp 2003-07-02 15:01:30.0 -0400
@@ -29,12 +29,13 @@
EVT_CLOSE( frmVacuum::OnClose)
END_EVENT_TABLE()
-#define chkFull CTRL("chkFull", wxCheckBox)
-#define chkFreeze CTRL("chkFreeze", wxCheckBox)
-#define chkAnalyze CTRL("chkAnalyze", wxCheckBox)
-#define stBitmapCTRL("stBitmap", wxStaticBitmap)
-#define btnOK CTRL("btnOK", wxButton)
-#define btnCancel CTRL("btnCancel", wxButton)
+#define chkFull CTRL("chkFull", wxCheckBox)
+#define chkFreeze CTRL("chkFreeze", wxCheckBox)
+#define chkAnalyze CTRL("chkAnalyze", wxCheckBox)
+#define chkAnalyzeOnly CTRL("chkAnalyzeOnly", wxCheckBox)
+#define stBitmapCTRL("stBitmap", wxStaticBitmap)
+#define btnOK CTRL("btnOK", wxButton)
+#define btnCancel CTRL("btnCancel", wxButton)
@@ -86,14 +87,20 @@
{
btnOK->Disable();
-wxString sql=wxT("VACUUM ");
+wxString sql;
+if (chkAnalyzeOnly->GetValue())
+sql = wxT("ANALYZE ");
+else
+{
+sql=wxT("VACUUM ");
-if (chkFull->GetValue())
-sql += wxT("FULL ");
-if (chkFreeze->GetValue())
-sql += wxT("FREEZE ");
-if (chkAnalyze->GetValue())
-sql += wxT("ANALYZE ");
+if (chkFull->GetValue())
+sql += wxT("FULL ");
+if (chkFreeze->GetValue())
+sql += wxT("FREEZE ");
+if (chkAnalyze->GetValue())
+sql += wxT("ANALYZE ");
+}
if (object->GetType() != PG_DATABASE)
sql += object->GetTypeName() + wxT(" ")
@@ -115,6 +122,8 @@
// here could be the animation
}
+if (thread->DataSet() != NULL)
+wxLogDebug(wxString::Format(_("%d rows."), thread->DataSet()->NumRows()));
if (thread)
{
btnOK->SetLabel(_("Done"));
---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly