Brian Dunning Inefficient query is melting my server!!
Oct 19, 2011; 12:16
Brian Dunning
Inefficient query is melting my server!!
Can someone tell me if what I'm trying to do can be done more efficiently? I just got off the phone with Rackspace when my server was hung up, and they found a whole bunch of this one same query was all stacked up with waiting queries and locked.
Here's the query:
$query = "insert ignore into stats (ip,id,type,date,time) values ('".$_SERVER['REMOTE_ADDR']."','$id','listen',NOW(),NOW())";
Here's the table:
CREATE TABLE IF NOT EXISTS `stats` ( `ip` varchar(20) NOT NULL default '', `id` mediumint(9) NOT NULL default '0', `type` varchar(20) NOT NULL default '', `date` date NOT NULL default '0000-00-00', `time` time NOT NULL default '00:00:00', PRIMARY KEY (`ip`,`id`,`type`), KEY `report` (`id`,`date`), KEY `type_date` (`type`,`date`), KEY `id_type` (`id`,`type`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
There are about 16.5 million records in the table.
Thanks!
- Brian -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/mysql?unsub=listsearcharchive@lassosoft.com
Oct 19
Johan De Meersman Re: Inefficient query is melting my server!!
Oct 19, 2011; 21:54
Johan De Meersman
Re: Inefficient query is melting my server!!
Oct 19
Basil Daoust Re: Inefficient query is melting my server!!
Oct 19, 2011; 17:13
Basil Daoust
Re: Inefficient query is melting my server!!
Search
Lasso Programming
This site manages and broadcasts several email lists pertaining to Lasso Programming and technologies related and used by Lasso developers. Sign up today!