List:General Discussion« Previous MessageNext Message »
From:hewei Date:June 17 2010 4:35am
Subject:why the sql so slowly?
View as plain text  
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?

Thread
why the sql so slowly?hewei17 Jun
  • Re: why the sql so slowly?Ananda Kumar17 Jun
    • Re: why the sql so slowly?hewei17 Jun
      • Re: why the sql so slowly?Ananda Kumar17 Jun
        • Re: why the sql so slowly?hewei17 Jun
          • Re: why the sql so slowly?Nguyen Manh Cuong19 Jul