From: Ananda Kumar Date: June 17 2010 6:47am Subject: Re: why the sql so slowly? List-Archive: http://lists.mysql.com/mysql/221943 Message-Id: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary=000e0cd5d1da1b5c180489343761 --000e0cd5d1da1b5c180489343761 Content-Type: text/plain; charset=ISO-8859-1 How many records are there in this table. What is the select statement ur running. regards anandkl On Thu, Jun 17, 2010 at 10:05 AM, hewei wrote: > now , I need to select a table per minute. > 1. > the table struture: > ----------------------------------------------------------------- > CREATE TABLE `table_code` ( > `timestamp` timestamp NULL default CURRENT_TIMESTAMP on update > CURRENT_TIMESTAMP, > `code` decimal(5,0) NOT NULL default '0', > PRIMARY KEY (`stock_code`) > ) > ----------------------------------------------------------------- > 2. > there is a trigger will insert data into the table `table_code` > the trigger is like: > ----------------------------------------------------------------- > if .... then > insert into table_code.... > end if; > ----------------------------------------------------------------- > 3. > I need to select the table 'table_code' per minute,and the sql is like : > select code from table_code; > > now, the problem is: > in normally,the sql executed very fast (0.5-1 second), but sometimes, it > will take more than 3 minutes. I don't know > why? how to find the cause? > --000e0cd5d1da1b5c180489343761--