TheWitness wrote:Run two commands for me:
Code: Select all
explain SELECT DISTINCT field_name FROM data_local AS dl INNER JOIN host_snmp_cache AS hsc ON dl.snmp_query_id=hsc.snmp_query_id WHERE dl.data_template_id=41
Hanging the Mysql Process where snmp_cache is large. For new installation working fine .But why u need this.Old thold working fine on same setup..
mysql> show create table data_local;
+------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| data_local | CREATE TABLE `data_local` (
`id` mediumint(8) unsigned NOT NULL auto_increment,
`data_template_id` mediumint(8) unsigned NOT NULL default '0',
`host_id` mediumint(8) unsigned NOT NULL default '0',
`snmp_query_id` mediumint(8) NOT NULL default '0',
`snmp_index` varchar(255) NOT NULL default '',
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=19028 DEFAULT CHARSET=latin1 |
+------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
mysql> show create table host_snmp_cache;
+-----------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-----------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| host_snmp_cache | CREATE TABLE `host_snmp_cache` (
`host_id` mediumint(8) unsigned NOT NULL default '0',
`snmp_query_id` mediumint(8) unsigned NOT NULL default '0',
`field_name` varchar(50) NOT NULL default '',
`field_value` varchar(255) default NULL,
`snmp_index` varchar(255) NOT NULL default '',
`oid` text NOT NULL,
PRIMARY KEY (`host_id`,`snmp_query_id`,`field_name`,`snmp_index`),
KEY `host_id` (`host_id`,`field_name`),
KEY `snmp_index` (`snmp_index`),
KEY `field_name` (`field_name`),
KEY `field_value` (`field_value`),
KEY `snmp_query_id` (`snmp_query_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 |
+-----------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
For the second issue, here is a patch that we will be releasing soon. You will have to reindex your hosts though: