Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 ()
    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;
    UPDATE `avsn_assets` SET `rgt` = currentLft + 1 WHERE `id` = cateGoryId;    
share|improve this question

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 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.

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

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