Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

When executing the attached procedure, mysql hangs up and does not replay anymore until cancelling the task. It is installed locally on a windows machine. Its whole performance is terribly. What to do?

//edit: System information: 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;
share|improve this question
add comment

closed as off topic by John Gardeniers, EEAA, Ladadadada, Michael Hampton, Ward Jan 13 '13 at 23:24

Questions on Server Fault are expected to relate to professional server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer

up vote 0 down vote accepted

Okay, I have found the problem....It is the hard disk slowing down the server.

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.