How can I run a query multiple times in phpmyadmin?

前端 未结 3 1965
梦谈多话
梦谈多话 2021-01-21 20:03

I want a way to be able to benchmark a query like 1,000,000 times. What\'s the easiest way to do this? Currently I\'ve searched for a way to issue a query multiple times but not

3条回答
  •  Happy的楠姐
    2021-01-21 20:42

    From the MySQL Documentation:

    CREATE PROCEDURE doiterate(p1 INT)
    BEGIN
      label1: LOOP
        SET p1 = p1 + 1;
        (Your real query would go here)
        IF p1 < 10 THEN ITERATE label1; END IF;
        LEAVE label1;
      END LOOP label1;
      SET @x = p1;
    END;
    

    You could paste this code in phpmyadmin's SQL tab, then run it.

提交回复
热议问题