MySQL 服务器在繁重的计算负载下停止工作

MySQL 服务器在繁重的计算负载下停止工作

执行附件过程时mysql挂了,直到取消任务才重新运行。本地安装在windows机器上。整体性能很差。怎么办?

//编辑:系统信息:i7 3GHz、8GB RAM、Windows 8。

CREATE PROCEDURE fix_lft_rgt_news ()
BEGIN
    DECLARE i INT DEFAULT 1;
    DECLARE v_char VARCHAR(1);
    DECLARE maximumId INT DEFAULT 1;
    DECLARE currentId INT DEFAULT 1;
    DECLARE currentLft INT DEFAULT 1;
    DECLARE categoryLft INT DEFAULT 1;
    DECLARE categoryId INT DEFAULT 1;
    DECLARE v_parseStr VARCHAR(255) DEFAULT ' ';

    SELECT MIN(id) INTO i FROM avsn_assets WHERE name LIKE 'com_content.article%';
    SELECT id INTO categoryId FROM avsn_assets WHERE title = 'News' AND name LIKE 'com_content.category%';
    SELECT lft INTO categoryLft FROM avsn_assets WHERE title = 'News' AND name LIKE 'com_content.category%';
    SELECT MAX(id) INTO maximumId FROM avsn_assets WHERE name LIKE 'com_content.article%';
    SET currentLft = categoryId + 1;

    WHILE (i <= maximumId )  DO 

        UPDATE `avsn_assets` SET `lft` = currentLft WHERE `id` = i;
        UPDATE `avsn_assets` SET `rgt` = currentLft + 1 WHERE `id` = i;

        SET currentLft = currentLft + 2;

        SET i = i + 1;
    END WHILE;
    UPDATE `avsn_assets` SET `rgt` = currentLft + 1 WHERE `id` = cateGoryId;    
END;

答案1

好的,我找到问题了......是硬盘拖慢了服务器的速度。

相关内容