This question is related to:
It uses this code:
CREATE PROCEDURE myProc(IN t1 timestamp, IN t2 timestamp)
BEGIN
WHILE t1 <= t2 DO
INSERT INTO test (ts) Values (t1) ;
SET t1 = DATE_ADD(t1, INTERVAL 3 MINUTE);
END WHILE;
END;
invoke like this:
CALL myProc(now(), ADDDATE(NOW(), INTERVAL 15 MINUTE));
which is extremely slow. Is there any way to speed this up (e.g. do things differently)?