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 <heweiwe...@gmail.com> 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? >