workaround for slow INFORMATION_SCHEMA queries about views
This commit is contained in:
@@ -5,6 +5,13 @@ phpMyAdmin - ChangeLog
|
|||||||
$Id$
|
$Id$
|
||||||
$HeadURL$
|
$HeadURL$
|
||||||
|
|
||||||
|
2007-01-21 Marc Delisle <lem9@users.sourceforge.net>
|
||||||
|
* libraries/Table.class.php: on a MySQL 5.0.33 server with 4400 databases,
|
||||||
|
one of which having 400 tables, it took more than 3 minutes just to
|
||||||
|
see the database structure (some accesses to INFORMATION_SCHEMA are
|
||||||
|
just too slow) so I changed PMA_Table::isView() to avoid calling
|
||||||
|
INFORMATION_SCHEMA
|
||||||
|
|
||||||
2007-01-20 Marc Delisle <lem9@users.sourceforge.net>
|
2007-01-20 Marc Delisle <lem9@users.sourceforge.net>
|
||||||
* libraries/sqlparser.lib.php: bug #1638267, wrong reserved word
|
* libraries/sqlparser.lib.php: bug #1638267, wrong reserved word
|
||||||
recognition
|
recognition
|
||||||
|
@@ -233,11 +233,20 @@ class PMA_Table {
|
|||||||
if (PMA_MYSQL_INT_VERSION < 50000) {
|
if (PMA_MYSQL_INT_VERSION < 50000) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (false === PMA_DBI_fetch_value('SELECT TABLE_NAME FROM `information_schema`.`VIEWS` WHERE `TABLE_SCHEMA` = \'' . $db . '\' AND `TABLE_NAME` = \'' . $table . '\';')) {
|
// This would be the correct way of doing the check but at least in
|
||||||
|
// MySQL 5.0.33 it's too slow when there are hundreds of databases
|
||||||
|
// and/or tables (more than 3 minutes for 400 tables)
|
||||||
|
/*if (false === PMA_DBI_fetch_value('SELECT TABLE_NAME FROM `information_schema`.`VIEWS` WHERE `TABLE_SCHEMA` = \'' . $db . '\' AND `TABLE_NAME` = \'' . $table . '\';')) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
return true;
|
return true;
|
||||||
}
|
} */
|
||||||
|
// A more complete verification would be to check if all columns
|
||||||
|
// from the result set are NULL except Name and Comment.
|
||||||
|
// MySQL from 5.0.0 to 5.0.12 returns 'view',
|
||||||
|
// from 5.0.13 returns 'VIEW'.
|
||||||
|
$comment = strtoupper(PMA_DBI_fetch_value('SHOW TABLE STATUS FROM ' . PMA_backquote($db) . ' LIKE \'' . $table . '\'', 0, 'Comment'));
|
||||||
|
return ($comment == 'VIEW');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user