summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <heikki@hundin.mysql.fi>2003-04-24 15:34:43 +0300
committerunknown <heikki@hundin.mysql.fi>2003-04-24 15:34:43 +0300
commit1e8414803c0e3583ec729954236c3498d739d26a (patch)
treee9f2a3c82363f345c8c2e5c14bbea6edf4c8ea81
parentcdf3e090e5d1cd9a0aaf17dba52acf39abdfe1a1 (diff)
downloadmariadb-git-1e8414803c0e3583ec729954236c3498d739d26a.tar.gz
ha_innodb.h, ha_innodb.cc:
Make ANALYZE TABLE to update index cardinality and other statistics also for an InnoDB table; note that the estimates are based on 10 random dives, not on an exhaustive read of the table sql/ha_innodb.cc: Make ANALYZE TABLE to update index cardinality and other statistics also for an InnoDB table; note that the estimates are based on 10 random dives, not on an exhaustive read of the table sql/ha_innodb.h: Make ANALYZE TABLE to update index cardinality and other statistics also for an InnoDB table; note that the estimates are based on 10 random dives, not on an exhaustive read of the table
-rw-r--r--sql/ha_innodb.cc17
-rw-r--r--sql/ha_innodb.h1
2 files changed, 18 insertions, 0 deletions
diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc
index 5cd8a285d0c..8d682deb583 100644
--- a/sql/ha_innodb.cc
+++ b/sql/ha_innodb.cc
@@ -3756,6 +3756,23 @@ ha_innobase::info(
DBUG_VOID_RETURN;
}
+/**************************************************************************
+Updates index cardinalities of the table, based on 10 random dives into
+each index tree. This does NOT calculate exact statistics of the table. */
+
+int
+ha_innobase::analyze(
+/*=================*/
+ /* out: returns always 0 (success) */
+ THD* thd, /* in: connection thread handle */
+ HA_CHECK_OPT* check_opt) /* in: currently ignored */
+{
+ /* Simply call ::info() with all the flags */
+ info(HA_STATUS_TIME | HA_STATUS_CONST | HA_STATUS_VARIABLE);
+
+ return(0);
+}
+
/***********************************************************************
Tries to check that an InnoDB table is not corrupted. If corruption is
noticed, prints to stderr information about it. In case of corruption
diff --git a/sql/ha_innodb.h b/sql/ha_innodb.h
index d79f12c7ac2..5677d22a2ca 100644
--- a/sql/ha_innodb.h
+++ b/sql/ha_innodb.h
@@ -152,6 +152,7 @@ class ha_innobase: public handler
void position(const byte *record);
void info(uint);
+ int analyze(THD* thd,HA_CHECK_OPT* check_opt);
int extra(enum ha_extra_function operation);
int reset(void);
int external_lock(THD *thd, int lock_type);